{"id":6175,"date":"2019-09-04T18:41:03","date_gmt":"2019-09-04T09:41:03","guid":{"rendered":"http:\/\/auctionpro.co.kr\/?p=6175"},"modified":"2025-05-07T18:31:47","modified_gmt":"2025-05-07T09:31:47","slug":"winscp","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=6175","title":{"rendered":"WinSCP"},"content":{"rendered":"\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/winscp.net\/eng\/docs\/guide_automation\n<\/div><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Automate file transfers (or synchronization) to FTP server or SFTP serve<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Script.bat<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" title=\"Script.bat\">@echo off\n\n:: log folder\nSET Folder=\"C:\\var\\log\\\"\n \nIF EXIST %Folder%*.txt ( rem file exist\n  :: ECHO %F% is existing\n  echo y| move  %Folder%*.txt %Folder%temp\\ \n  \n  winscp.com \/ini=nul \/script=C:\\\"Program Files (x86)\"\\WinSCP\\Log_SFTP.txt\n    \n  if %ERRORLEVEL% neq 0 goto error\n \n\techo Success\n\t  :: echo y| del  %Folder%temp\\*.txt\n\t  echo y| move  %Folder%temp\\*.txt %Folder%log\\ \n\t exit \/b 0\n\t \n\t:error\n\techo Error!\n\t   echo \"Error............\"\n\t exit \/b 1\n)<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Log_SFTP.txt<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" title=\"Connect to SFTP server using a password\"># Connect to SFTP server using a password\nopen sftp:\/\/ID:Password@111.222.222.222:2525 -hostkey=\"ssh-ed25519 256 **********************************=\"\n# Upload file\nput %Folder%temp\\*.txt \/\uc11c\ubc84\ud3f4\ub354\uacbd\ub85c\/\n# Exit WinSCP\nexit<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\uc608\uc81c 2<br><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2023\/03\/WinSCP_Batch.png\"><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"1024\" src=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2023\/03\/WinSCP_Batch-658x1024.png\" alt=\"\" class=\"wp-image-8627\" srcset=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2023\/03\/WinSCP_Batch-658x1024.png 658w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2023\/03\/WinSCP_Batch-193x300.png 193w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2023\/03\/WinSCP_Batch-660x1027.png 660w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2023\/03\/WinSCP_Batch.png 751w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/a><\/figure>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" title=\"LogFTPScript.bat\">@echo off\n \n:: log folder\n\nSET Folder=\"D:\\Log\"\nSET yyyymmdd=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%\n \nIF EXIST %Folder%\\%yyyymmdd%\\*.xml ( rem file exist\n  :: ECHO %F% is existing\n  echo y| move  %Folder%\\%yyyymmdd%\\*.log %Folder%\\Temp\\\n  \n  winscp.com \/ini=nul \/script=C:\\\"Program Files (x86)\"\\WinSCP\\Log_SFTP.txt\n    \n  if %ERRORLEVEL% neq 0 goto error\n \n\techo Success\n\t  :: echo y| del  %Folder%temp\\*.txt\n\t  echo y| move  %Folder%\\Temp\\*.log %Folder%\\Log\\\n\t exit \/b 0\n\t \n\t:error\n\techo Error!\n\t   echo \"Error............\"\n\t exit \/b 1\n)<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" title=\"Log_SFTP.txt\"># Connect to SFTP server using a password\nopen ftp:\/\/MYID:MYPASSWORD@111.222.111.222:54325 -passive=on\n# Upload file\n# put %Folder%\\%yyyymmdd%\\ \/\nput %Folder%\\Temp\\*.log \/%yyyymmdd%\/\n# Exit WinSCP\nexit<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\uc624\ub958\uc2dc : \ud30c\uc77c \uc5c5\ub85c\ub4dc\uc2dc , \ud30c\uc77c\uc744 \uc131\uacf5\uc801\uc73c\ub85c \uc5c5\ub85c\ub4dc \ud588\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \uad8c\ud55c \ub610\ub294 \uc2dc\uac04 \uc124\uc815\uc744 \ud558\ub294 \ub3c4\uc911 \uc624\ub958\uac00 \ubc1c\ud589\ud558\ub294 \uacbd\uc6b0. \uc11c\ubc84 \uc624\ub958 \uba54\uc2dc\uc9c0 US-ASCII : SETSATE unsupported<br><br>\uc124\uc815<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2019\/09\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"683\" height=\"592\" src=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2019\/09\/image-2.png\" alt=\"\" class=\"wp-image-9765\" srcset=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2019\/09\/image-2.png 683w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2019\/09\/image-2-300x260.png 300w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Winscp.com \uc624\ub958 : <\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\ub85c\uadf8 \uc800\uc7a5 \uc635\uc158 : <strong>\/log=<\/strong>&#8220;\uacbd\ub85c\/\ud30c\uc77c&#8221;<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">winscp.com \/ini=nul \/script=C:\\SFTP.txt \/log=\"C:\\Logs\\winscp.log\"<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\uc624\ub958 \ub0b4\uc6a9:<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">. 2025-05-07 14:17:52.843 Preserving timestamp [2025-05-05T15:31:08.000Z]\n&lt; 2025-05-07 14:17:52.843 Type: SSH_FXP_STATUS, Size: 44, Number: 777\n&lt; 2025-05-07 14:17:52.843 Status code: 8, Message: 777, Server: SETSTAT unsupported, Language: US-ASCII \n* 2025-05-07 14:17:52.843 (ETerminal) \uc11c\ubc84\uac00 \uc774 \uc791\uc5c5\uc744 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\n* 2025-05-07 14:17:52.843 \uc624\ub958 \ucf54\ub4dc: 8\n* 2025-05-07 14:17:52.843 \uc11c\ubc84 \uc624\ub958 \uba54\uc2dc\uc9c0: (US-ASCII): SETSTAT unsupported\n. 2025-05-07 14:17:52.843 Asking user:\n. 2025-05-07 14:17:52.843 **'TEST20250505.TXT' \ud30c\uc77c\uc744 \uc131\uacf5\uc801\uc73c\ub85c \uc5c5\ub85c\ub4dc \ud588\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \uad8c\ud55c \ub610\ub294 \uc2dc\uac04 \uc124\uc815\uc744 \ud558\ub294 \ub3c4\uc911 \uc624\ub958\uac00 \ubc1c\uc0dd \ud558\uc600\uc2b5\ub2c8\ub2e4.**\n. 2025-05-07 14:17:52.843 \n. 2025-05-07 14:17:52.843 \ub9cc\uc57d \uc774 \ubb38\uc81c\uac00 \uc9c0\uc18d\ub418\uba74, \uad8c\ud55c \ub610\ub294 \uc2dc\uac04 \uc18d\uc131 \uc720\uc9c0 \uc124\uc815\uc744 \ub044\uac70\ub098 '\uad8c\ud55c \uc624\ub958 \ubb34\uc2dc' \uc635\uc158\uc744 \uc124\uc815 \ud558\uc2ed\uc2dc\uc694. (\"\uc11c\ubc84\uac00 \uc774 \uc791\uc5c5\uc744 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\n. 2025-05-07 14:17:52.843 \uc624\ub958 \ucf54\ub4dc: 8\n. 2025-05-07 14:17:52.843 \uc11c\ubc84 \uc624\ub958 \uba54\uc2dc\uc9c0: (US-ASCII): SETSTAT unsupported\")\n&lt; 2025-05-07 14:17:52.843 Script: 'TEST20250505.TXT' \ud30c\uc77c\uc744 \uc131\uacf5\uc801\uc73c\ub85c \uc5c5\ub85c\ub4dc \ud588\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \uad8c\ud55c \ub610\ub294 \uc2dc\uac04 \uc124\uc815\uc744 \ud558\ub294 \ub3c4\uc911 \uc624\ub958\uac00 \ubc1c\uc0dd \ud558\uc600\uc2b5\ub2c8\ub2e4.\n&lt; 2025-05-07 14:17:52.843 \ub9cc\uc57d \uc774 \ubb38\uc81c\uac00 \uc9c0\uc18d\ub418\uba74, \uad8c\ud55c \ub610\ub294 \uc2dc\uac04 \uc18d\uc131 \uc720\uc9c0 \uc124\uc815\uc744 \ub044\uac70\ub098 '\uad8c\ud55c \uc624\ub958 \ubb34\uc2dc' \uc635\uc158\uc744 \uc124\uc815 \ud558\uc2ed\uc2dc\uc694.\n&lt; 2025-05-07 14:17:52.843 Script: \uc11c\ubc84\uac00 \uc774 \uc791\uc5c5\uc744 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\n&lt; 2025-05-07 14:17:52.843 \uc624\ub958 \ucf54\ub4dc: 8\n&lt; 2025-05-07 14:17:52.843 \uc11c\ubc84 \uc624\ub958 \uba54\uc2dc\uc9c0: (US-ASCII): SETSTAT unsupported\n* 2025-05-07 14:17:52.844 (ESkipFile) **'TEST20250505.TXT' \ud30c\uc77c\uc744 \uc131\uacf5\uc801\uc73c\ub85c \uc5c5\ub85c\ub4dc \ud588\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \uad8c\ud55c \ub610\ub294 \uc2dc\uac04 \uc124\uc815\uc744 \ud558\ub294 \ub3c4\uc911 \uc624\ub958\uac00 \ubc1c\uc0dd \ud558\uc600\uc2b5\ub2c8\ub2e4.**\n* 2025-05-07 14:17:52.844 \n* 2025-05-07 14:17:52.844 \ub9cc\uc57d \uc774 \ubb38\uc81c\uac00 \uc9c0\uc18d\ub418\uba74, \uad8c\ud55c \ub610\ub294 \uc2dc\uac04 \uc18d\uc131 \uc720\uc9c0 \uc124\uc815\uc744 \ub044\uac70\ub098 '\uad8c\ud55c \uc624\ub958 \ubb34\uc2dc' \uc635\uc158\uc744 \uc124\uc815 \ud558\uc2ed\uc2dc\uc694.\n* 2025-05-07 14:17:52.844 \uc11c\ubc84\uac00 \uc774 \uc791\uc5c5\uc744 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\n* 2025-05-07 14:17:52.844 \uc624\ub958 \ucf54\ub4dc: 8\n* 2025-05-07 14:17:52.844 \uc11c\ubc84 \uc624\ub958 \uba54\uc2dc\uc9c0: (US-ASCII): SETSTAT unsupported\n. 2025-05-07 14:17:52.844 Copying finished: Transferred: 35,295, Elapsed: 0:00:00, CPS: 27,516\/s\n. 2025-05-07 14:17:52.844 Script: Failed\n. 2025-05-07 14:17:52.844 Script: Exit code: 1\n. 2025-05-07 14:17:52.844 Closing connection.\n. 2025-05-07 14:17:52.844 Sending special code: 12\n. 2025-05-07 14:17:52.844 Sent EOF message<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\ud574\uacb0 : -nopermissions -nopreservetime  \uc635\uc158 \ucd94\uac00<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" title=\"Log_SFTP.txt\"># Connect to SFTP server using a password\nopen -nopermissions -nopreservetime ftp:\/\/MYID:MYPASSWORD@111.222.111.222:54325 -passive=on\n# Upload file\n# put %Folder%\\%yyyymmdd%\\ \/\nput -nopermissions -nopreservetime %Folder%\\Temp\\*.log \/%yyyymmdd%\/\n# Exit WinSCP\nexit<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Automate file transfers (or synchronization) to FTP server or SFTP serve Script.bat Log_SFTP.txt \uc608\uc81c 2 \uc624\ub958\uc2dc : \ud30c\uc77c \uc5c5\ub85c\ub4dc\uc2dc , \ud30c\uc77c\uc744 \uc131\uacf5\uc801\uc73c\ub85c \uc5c5\ub85c\ub4dc \ud588\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=6175\" title=\"WinSCP\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[245],"tags":[],"class_list":["post-6175","post","type-post","status-publish","format-standard","hentry","category--batch-file"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/6175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6175"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/6175\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}