Error 12
Why does it return error 12?. I know that the error code 12 means that the file is on read-only media, or the media is write protected, but i'm the owner file and the file permissions are -rw-r----
This is my bat file:
This is the script file:
. 2015-04-18 08:47:06.208 Closing connection. . 2015-04-18 08:47:06.208 Sending special code: 12 . 2015-04-18 08:47:06.208 Sent EOF message . 2015-04-18 08:47:06.208 [Shell] Closing connection. . 2015-04-18 08:47:06.208 [Shell] Sending special code: 12 . 2015-04-18 08:47:06.208 [Shell] Sent EOF message
This is my bat file:
@echo on start /wait /D "C:\xFTP applications\WinSCP\" WinSCP.com /log="C:\xFTP applications\Logs\winSCP.log" /loglevel=0 /script="C:\xFTP applications\Scripts\test1.txt" 2>> ERROR_REG.log
This is the script file:
. 2015-04-18 08:46:52.768 -------------------------------------------------------------------------- . 2015-04-18 08:46:52.768 WinSCP Version 5.1.7 (Build 3446) (OS 6.1.7601 Service Pack 1) . 2015-04-18 08:46:52.768 Configuration: C:\xFTP applications\WinSCP\WinSCP.ini . 2015-04-18 08:46:52.768 Local account: domain\user . 2015-04-18 08:46:52.768 Working directory: C:\xFTP applications\WinSCP . 2015-04-18 08:46:52.768 Process ID: 7020 . 2015-04-18 08:46:52.768 Command-line: "C:\xFTP applications\WinSCP\WinSCP.exe" /log="C:\xFTP applications\Logs\winSCP.log" /loglevel=0 /console /script="C:\xFTP applications\Scripts\test1.txt" . 2015-04-18 08:46:52.768 Time zone: Current: GMT+2, Standard: GMT+1, DST: GMT+2, DST Start: 29/03/2015, DST End: 25/10/2015 . 2015-04-18 08:46:52.768 Login time: sábado, 18 de abril de 2015 8:46:52 . 2015-04-18 08:46:52.768 -------------------------------------------------------------------------- . 2015-04-18 08:46:52.768 Session name: userName@IP (Ad-Hoc session) . 2015-04-18 08:46:52.768 Host name: IP (Port: 22) . 2015-04-18 08:46:52.768 User name: userName (Password: Yes, Key file: No) . 2015-04-18 08:46:52.768 Tunnel: No . 2015-04-18 08:46:52.768 Transfer Protocol: SFTP . 2015-04-18 08:46:52.768 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec . 2015-04-18 08:46:52.768 Proxy: none . 2015-04-18 08:46:52.768 SSH protocol version: 2; Compression: No . 2015-04-18 08:46:52.768 Bypass authentication: No . 2015-04-18 08:46:52.768 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No . 2015-04-18 08:46:52.768 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No . 2015-04-18 08:46:52.768 SSH Bugs: A,A,A,A,A,A,A,A,A,A . 2015-04-18 08:46:52.768 Return code variable: Autodetect; Lookup user groups: A . 2015-04-18 08:46:52.768 Shell: default . 2015-04-18 08:46:52.768 EOL: 0, UTF: 2 . 2015-04-18 08:46:52.768 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes . 2015-04-18 08:46:52.768 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No . 2015-04-18 08:46:52.768 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes . 2015-04-18 08:46:52.768 Cache directory changes: Yes, Permanent: Yes . 2015-04-18 08:46:52.768 DST mode: 1; Timezone offset: 0h 0m . 2015-04-18 08:46:52.768 -------------------------------------------------------------------------- . 2015-04-18 08:46:52.768 Looking up host "IP" . 2015-04-18 08:46:52.768 Connecting to IP port 22 . 2015-04-18 08:46:53.288 Server version: SSH-2.0-OpenSSH_5.0 . 2015-04-18 08:46:53.288 Using SSH protocol version 2 . 2015-04-18 08:46:53.288 We claim version: SSH-2.0-WinSCP_release_5.1.7 . 2015-04-18 08:46:53.528 Doing Diffie-Hellman group exchange . 2015-04-18 08:46:54.218 Doing Diffie-Hellman key exchange with hash SHA-1 . 2015-04-18 08:46:54.718 Verifying host key rsa2 0x23,0xbbb4bcd3cef74bca 334134eb0780d16e 484856c63cab5066 05d642138d778ea4 6f0d93a59ea08e40 916146fceac43ccd 05fbaea51005f03a 0c0e8f8a95b2e510 86efce353eec8a83 c822364ac03d6cac 9c64cba724d9c97e a605e022fcb6736c 40afe7a32731ecea 890239b17e6c88fc ac4ec2d568fb62bd 346238d8fe81c5f6 2318b73e38b8be0b 4e47569dfcc4a8bd c1e6ccc3cf5ecdc3 86bf69d98d055848 6b5dc13025cfaffd 1233addf1e0f58d6 11c7e6efa0326666 97fb95ee6ee0ace1 da1bca1624d09782 14cc477158b4f889 f6e51574d5944330 519580c9d16d1722 610445ae21e820f1 c9d80d610a736223 d6dc9a7fa24db430 40899916c8cfcd73 with fingerprint ssh-rsa 2048 b2:56:2f:b0:52:c6:01:1a:54:09:d6:2a:c6:db:a1:cf . 2015-04-18 08:46:54.718 Host key matches configured key . 2015-04-18 08:46:54.718 Host key fingerprint is: . 2015-04-18 08:46:54.718 ssh-rsa 2048 b2:56:2f:b0:52:c6:01:1a:54:09:d6:2a:c6:db:a1:cf . 2015-04-18 08:46:54.718 Initialised AES-256 SDCTR client->server encryption . 2015-04-18 08:46:54.718 Initialised HMAC-SHA1 client->server MAC algorithm . 2015-04-18 08:46:54.718 Initialised AES-256 SDCTR server->client encryption . 2015-04-18 08:46:54.718 Initialised HMAC-SHA1 server->client MAC algorithm ! 2015-04-18 08:46:55.388 Using username "userName". . 2015-04-18 08:46:55.638 Attempting keyboard-interactive authentication . 2015-04-18 08:46:55.868 Server refused keyboard-interactive authentication . 2015-04-18 08:46:55.868 Prompt (7, SSH password, , &Password: ) . 2015-04-18 08:46:55.868 Using stored password. . 2015-04-18 08:46:55.868 Sent password . 2015-04-18 08:46:56.118 Access granted . 2015-04-18 08:46:56.368 Opened channel for session . 2015-04-18 08:46:56.998 Started a shell/command . 2015-04-18 08:46:56.998 -------------------------------------------------------------------------- . 2015-04-18 08:46:56.998 Using SFTP protocol. . 2015-04-18 08:46:56.998 Doing startup conversation with host. > 2015-04-18 08:46:56.998 Type: SSH_FXP_INIT, Size: 5, Number: -1 < 2015-04-18 08:46:57.238 Type: SSH_FXP_VERSION, Size: 38, Number: -1 . 2015-04-18 08:46:57.238 SFTP version 3 negotiated. . 2015-04-18 08:46:57.238 Unknown server extension posix-rename@openssh.com="1" . 2015-04-18 08:46:57.238 We believe the server has signed timestamps bug . 2015-04-18 08:46:57.238 We will use UTF-8 strings for status messages only . 2015-04-18 08:46:57.238 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes . 2015-04-18 08:46:57.238 Getting current directory name. . 2015-04-18 08:46:57.238 Getting real path for '.' > 2015-04-18 08:46:57.238 Type: SSH_FXP_REALPATH, Size: 10, Number: 16 < 2015-04-18 08:46:57.478 Type: SSH_FXP_NAME, Size: 47, Number: 16 . 2015-04-18 08:46:57.478 Real path is '/home/userName' . 2015-04-18 08:46:57.478 Startup conversation with host finished. < 2015-04-18 08:46:57.478 Script: Active session: [1] userName@IP > 2015-04-18 08:46:57.478 Script: cd /home/userName . 2015-04-18 08:46:57.478 Cached directory change via "/home/userName" to "/home/userName". . 2015-04-18 08:46:57.478 Getting current directory name. < 2015-04-18 08:46:57.478 Script: /home/userName > 2015-04-18 08:46:57.478 Script: lcd "C:\xFTP applications\Scripts_Result\" < 2015-04-18 08:46:57.478 Script: C:\xFTP applications\Scripts_Result\ > 2015-04-18 08:46:57.478 Script: Call test1.sh 150416 -M150416 < 2015-04-18 08:46:57.478 Script: Searching for host... . 2015-04-18 08:46:57.478 [Shell] Looking up host "IP" . 2015-04-18 08:46:57.478 [Shell] Connecting to IP port 22 < 2015-04-18 08:46:57.718 Script: Connecting to host... . 2015-04-18 08:46:57.978 [Shell] Server version: SSH-2.0-OpenSSH_5.0 . 2015-04-18 08:46:57.978 [Shell] Using SSH protocol version 2 . 2015-04-18 08:46:57.978 [Shell] We claim version: SSH-2.0-WinSCP_release_5.1.7 . 2015-04-18 08:46:58.218 [Shell] Doing Diffie-Hellman group exchange . 2015-04-18 08:46:58.808 [Shell] Doing Diffie-Hellman key exchange with hash SHA-1 . 2015-04-18 08:46:59.338 [Shell] Verifying host key rsa2 0x23,0xbbb4bcd3cef74bca 334134eb0780d16e 484856c63cab5066 05d642138d778ea4 6f0d93a59ea08e40 916146fceac43ccd 05fbaea51005f03a 0c0e8f8a95b2e510 86efce353eec8a83 c822364ac03d6cac 9c64cba724d9c97e a605e022fcb6736c 40afe7a32731ecea 890239b17e6c88fc ac4ec2d568fb62bd 346238d8fe81c5f6 2318b73e38b8be0b 4e47569dfcc4a8bd c1e6ccc3cf5ecdc3 86bf69d98d055848 6b5dc13025cfaffd 1233addf1e0f58d6 11c7e6efa0326666 97fb95ee6ee0ace1 da1bca1624d09782 14cc477158b4f889 f6e51574d5944330 519580c9d16d1722 610445ae21e820f1 c9d80d610a736223 d6dc9a7fa24db430 40899916c8cfcd73 with fingerprint ssh-rsa 2048 b2:56:2f:b0:52:c6:01:1a:54:09:d6:2a:c6:db:a1:cf < 2015-04-18 08:46:59.338 Script: Authenticating... . 2015-04-18 08:46:59.338 [Shell] Host key does not match configured key ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx . 2015-04-18 08:46:59.348 [Shell] Host key matches cached key . 2015-04-18 08:46:59.348 [Shell] Host key fingerprint is: . 2015-04-18 08:46:59.348 [Shell] ssh-rsa 2048 b2:56:2f:b0:52:c6:01:1a:54:09:d6:2a:c6:db:a1:cf . 2015-04-18 08:46:59.348 [Shell] Initialised AES-256 SDCTR client->server encryption . 2015-04-18 08:46:59.348 [Shell] Initialised HMAC-SHA1 client->server MAC algorithm . 2015-04-18 08:46:59.348 [Shell] Initialised AES-256 SDCTR server->client encryption . 2015-04-18 08:46:59.348 [Shell] Initialised HMAC-SHA1 server->client MAC algorithm ! 2015-04-18 08:47:00.008 [Shell] Using username "userName". < 2015-04-18 08:47:00.008 Script: Using username "userName". . 2015-04-18 08:47:00.258 [Shell] Attempting keyboard-interactive authentication . 2015-04-18 08:47:00.498 [Shell] Server refused keyboard-interactive authentication . 2015-04-18 08:47:00.498 [Shell] Prompt (7, SSH password, , &Password: ) . 2015-04-18 08:47:00.498 [Shell] Using stored password. < 2015-04-18 08:47:00.498 Script: Authenticating with pre-entered password. . 2015-04-18 08:47:00.498 [Shell] Sent password . 2015-04-18 08:47:00.738 [Shell] Access granted . 2015-04-18 08:47:00.978 [Shell] Opened channel for session . 2015-04-18 08:47:01.618 [Shell] Started a shell/command < 2015-04-18 08:47:01.618 Script: Authenticated. . 2015-04-18 08:47:01.618 [Shell] -------------------------------------------------------------------------- . 2015-04-18 08:47:01.618 [Shell] Using SCP protocol. . 2015-04-18 08:47:01.618 [Shell] Doing startup conversation with host. < 2015-04-18 08:47:01.618 Script: Starting the session... . 2015-04-18 08:47:01.618 [Shell] Skipping host startup message (if any). > 2015-04-18 08:47:01.618 [Shell] echo "WinSCP: this is end-of-file:0" < 2015-04-18 08:47:01.638 [Shell] [YOU HAVE NEW MAIL] < 2015-04-18 08:47:01.878 [Shell] WinSCP: this is end-of-file:0 . 2015-04-18 08:47:01.878 [Shell] Detecting variable containing return code of last command. . 2015-04-18 08:47:01.878 [Shell] Trying "$status". > 2015-04-18 08:47:01.878 [Shell] echo "$status" ; echo "WinSCP: this is end-of-file:0" < 2015-04-18 08:47:02.418 [Shell] WinSCP: this is end-of-file:0 . 2015-04-18 08:47:02.418 [Shell] The response is not numerical exit code . 2015-04-18 08:47:02.418 [Shell] Trying "$?". > 2015-04-18 08:47:02.418 [Shell] echo "$?" ; echo "WinSCP: this is end-of-file:0" < 2015-04-18 08:47:03.018 [Shell] 0 < 2015-04-18 08:47:03.018 [Shell] WinSCP: this is end-of-file:0 . 2015-04-18 08:47:03.018 [Shell] Return code variable "$?" selected. < 2015-04-18 08:47:03.018 Script: Reading remote directory... . 2015-04-18 08:47:03.018 [Shell] Changing directory to "/home/userName". > 2015-04-18 08:47:03.018 [Shell] cd "/home/userName" ; echo "WinSCP: this is end-of-file:$?" < 2015-04-18 08:47:03.618 [Shell] WinSCP: this is end-of-file:0 . 2015-04-18 08:47:03.628 [Shell] Getting current directory name. > 2015-04-18 08:47:03.628 [Shell] pwd ; echo "WinSCP: this is end-of-file:$?" < 2015-04-18 08:47:04.228 [Shell] /home/userName < 2015-04-18 08:47:04.228 [Shell] WinSCP: this is end-of-file:0 . 2015-04-18 08:47:04.228 [Shell] Startup conversation with host finished. < 2015-04-18 08:47:04.228 Script: Session started. . 2015-04-18 08:47:04.228 Executing user defined command on command session. > 2015-04-18 08:47:04.228 [Shell] test1.sh 150416 -M150416 ; echo "WinSCP: this is end-of-file:$?" < 2015-04-18 08:47:04.998 [Shell] WinSCP: this is end-of-file:0 * 2015-04-18 08:47:04.998 (ETerminal) Command 'test1.sh 150416 -M150416' * 2015-04-18 08:47:04.998 failed with return code 0 and error message < 2015-04-18 08:47:04.998 Script: Command 'test1.sh 150416 -M150416' < 2015-04-18 08:47:04.998 failed with return code 0 and error message . 2015-04-18 08:47:04.998 Script: Failed > 2015-04-18 08:47:04.998 Script: get test1.txt . 2015-04-18 08:47:04.998 Listing file "test1.txt". > 2015-04-18 08:47:04.998 Type: SSH_FXP_LSTAT, Size: 34, Number: 263 < 2015-04-18 08:47:05.238 Type: SSH_FXP_ATTRS, Size: 37, Number: 263 . 2015-04-18 08:47:05.238 test1.txt;-;137;2015-04-18T06:47:04.000Z;"" [1013];"" [305];rw-r-----;0 . 2015-04-18 08:47:05.238 File: "/home/userName/test1.txt" . 2015-04-18 08:47:05.238 Copying "/home/userName/test1.txt" to local directory started. . 2015-04-18 08:47:05.238 Binary transfer mode selected. . 2015-04-18 08:47:05.238 Opening remote file. > 2015-04-18 08:47:05.238 Type: SSH_FXP_OPEN, Size: 42, Number: 515 < 2015-04-18 08:47:05.478 Type: SSH_FXP_HANDLE, Size: 13, Number: 515 > 2015-04-18 08:47:05.478 Type: SSH_FXP_FSTAT, Size: 13, Number: 776 < 2015-04-18 08:47:05.718 Type: SSH_FXP_ATTRS, Size: 37, Number: 776 . 2015-04-18 08:47:05.718 Confirming overwriting of file. > 2015-04-18 08:47:05.718 Type: SSH_FXP_READ, Size: 25, Number: 1029 < 2015-04-18 08:47:06.208 Status code: 1 . 2015-04-18 08:47:06.208 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. > 2015-04-18 08:47:06.208 Type: SSH_FXP_CLOSE, Size: 13, Number: 1540 . 2015-04-18 08:47:06.208 Preserving timestamp [2015-04-18T06:47:04.000Z] > 2015-04-18 08:47:06.208 Script: close . 2015-04-18 08:47:06.208 Closing connection. . 2015-04-18 08:47:06.208 Sending special code: 12 . 2015-04-18 08:47:06.208 Sent EOF message . 2015-04-18 08:47:06.208 [Shell] Closing connection. . 2015-04-18 08:47:06.208 [Shell] Sending special code: 12 . 2015-04-18 08:47:06.208 [Shell] Sent EOF message