Successful Put transfer but errorcode 1 in WinScp V 416
Hello!
First of all, thank you very much for this great tool that really does a great job!
STill I do have problem with a script which always returns errorlevel 1 although I can verify the put transfer has been completed successfull. Furthermore I can not see any problem within the output of winscp nor in the log file.
Any help is highly appreciated...
Thank youe very much!
Chris
Here is the Batch file (Win XP, SP2) that calls WinSCP.com (V416, Build 412):
If exist active_put.txt goto end
subst r: d:\xyz_Transfer
:start
START /W .\DTHRMNSS.EXE
CALL .\DTHRMNSS.BAT
copy put.ftp active_put.txt
echo ------------- >> Put_FTP.LOG
echo %DTHRMNSS% >> Put_FTP.LOG
echo ------------- >> Put_FTP.LOG
winscp.com /log=.\winscp.log /script=r:\Quality\put.ftp >> Put_FTP.LOG
if errorlevel 1 goto ERROR
:error
echo ******** error **** >> Put_FTP.LOG
del active_put.txt
goto end
:noerr
move /Y r:\Quality\_xyz_Data_\Out\*.* r:\Quality\_xyz_Data_\_Old\Out\
del active_put.txt
net use R: /delete
:end
The script put.ftp:
open -timeout=30 sftp://removed:password@10.0.0.1
cd Data
option transfer binary
option batch on
option confirm off
put -nopermissions r:\Quality\_xyz_Data_\Out\*.*
close
exit
Here is the output of the Winscp script:
-------------
29082008075213
-------------
Searching for host...
Connecting to host...
Authenticating...
Using username "removed".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] removed@10.0.0.1
/daten/company/Data
transfer binary
batch on
confirm off
r:\Quality\_xyz_Data_\Out\Del_FTP.L | 0 KiB | 0,0 KiB/s | binary | 100%
Session 'removed@10.0.0.1' closed.
No session.
And finally the WinSCP Log:
. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 WinSCP Version 4.1.6 (Build 412) (OS 5.1.2600 Service Pack 2)
. 2008-08-29 07:52:14.515 Login time: Freitag, 29. August 2008 07:52:14
. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 Session name: removed@10.0.0.1
. 2008-08-29 07:52:14.515 Host name: 10.0.0.1 (Port: 22)
. 2008-08-29 07:52:14.515 User name: removed (Password: Yes, Key file: No)
. 2008-08-29 07:52:14.515 Tunnel: No
. 2008-08-29 07:52:14.515 Transfer Protocol: SFTP
. 2008-08-29 07:52:14.515 Ping type: -, Ping interval: 30 sec; Timeout: 30 sec
. 2008-08-29 07:52:14.515 Proxy: none
. 2008-08-29 07:52:14.515 SSH protocol version: 2; Compression: No
. 2008-08-29 07:52:14.515 Bypass authentication: No
. 2008-08-29 07:52:14.515 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2008-08-29 07:52:14.515 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2008-08-29 07:52:14.515 SSH Bugs: -,-,-,-,-,-,-,-
. 2008-08-29 07:52:14.515 SFTP Bugs: -,-
. 2008-08-29 07:52:14.515 Return code variable: Autodetect; Lookup user groups: Yes
. 2008-08-29 07:52:14.515 Shell: default, EOL: 0
. 2008-08-29 07:52:14.515 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2008-08-29 07:52:14.515 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2008-08-29 07:52:14.515 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2008-08-29 07:52:14.515 Cache directory changes: Yes, Permanent: Yes
. 2008-08-29 07:52:14.515 DST mode: 1
. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 Looking up host "10.0.0.1"
. 2008-08-29 07:52:14.515 Connecting to 10.0.0.1 port 22
. 2008-08-29 07:52:14.578 Server version: SSH-2.0-OpenSSH_4.5
. 2008-08-29 07:52:14.578 We claim version: SSH-2.0-WinSCP_release_4.1.6
. 2008-08-29 07:52:14.578 SSPI: acquired credentials for: username@Domain
. 2008-08-29 07:52:14.578 Cannot convert IP address to SPN: DNS is not trusted
. 2008-08-29 07:52:14.578 GSSKEX disabled: Der Vorgang wurde erfolgreich beendet.. 2008-08-29 07:52:14.578 Using SSH protocol version 2
. 2008-08-29 07:52:14.609 Doing Diffie-Hellman group exchange
. 2008-08-29 07:52:14.718 Doing Diffie-Hellman key exchange with hash SHA-1
. 2008-08-29 07:52:15.062 Host key fingerprint is:
. 2008-08-29 07:52:15.062 ssh-rsa 2048 02:57:f9:53:6d:8a:cc:f7:5f:02:57:f9:53:6d:8a
. 2008-08-29 07:52:15.062 Initialised AES-256 SDCTR client->server encryption
. 2008-08-29 07:52:15.062 Initialised HMAC-SHA1 client->server MAC algorithm
. 2008-08-29 07:52:15.062 Initialised AES-256 SDCTR server->client encryption
. 2008-08-29 07:52:15.062 Initialised HMAC-SHA1 server->client MAC algorithm
! 2008-08-29 07:52:15.156 Using username "removed".
. 2008-08-29 07:52:35.218 Prompt (6, SSH password, , &Password: )
. 2008-08-29 07:52:35.218 Using stored password.
. 2008-08-29 07:52:35.218 Sent password
. 2008-08-29 07:52:35.250 Access granted
. 2008-08-29 07:52:35.296 Opened channel for session
. 2008-08-29 07:52:35.359 Started a shell/command
. 2008-08-29 07:52:35.359 --------------------------------------------------------------------------
. 2008-08-29 07:52:35.359 Using SFTP protocol.
. 2008-08-29 07:52:35.359 Doing startup conversation with host.
> 2008-08-29 07:52:35.375 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2008-08-29 07:52:35.406 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2008-08-29 07:52:35.406 SFTP version 3 negotiated.
. 2008-08-29 07:52:35.406 We believe the server has signed timestamps bug
. 2008-08-29 07:52:35.406 We will use UTF-8 strings for status messages only
. 2008-08-29 07:52:35.406 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2008-08-29 07:52:35.406 Getting current directory name.
. 2008-08-29 07:52:35.406 Getting real path for '.'
> 2008-08-29 07:52:35.406 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2008-08-29 07:52:35.437 Type: SSH_FXP_NAME, Size: 47, Number: 16
. 2008-08-29 07:52:35.437 Real path is '/daten/company'
. 2008-08-29 07:52:35.437 Startup conversation with host finished.
. 2008-08-29 07:52:35.437 Cached directory change via "removed" to "/daten/company/Data".
. 2008-08-29 07:52:35.437 Getting current directory name.
. 2008-08-29 07:52:35.437 Copying 1 files/directories to remote directory "/daten/company/Data"
. 2008-08-29 07:52:35.437 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 01; Resume: S (102400); CalcS: No; Mask:
. 2008-08-29 07:52:35.437 TM: B; ClAr: No; CPS: 0; ExclM(No):
. 2008-08-29 07:52:35.437 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2008-08-29 07:52:35.453 File: "r:\Quality\_xyz_Data_\Out\Del_FTP.L"
. 2008-08-29 07:52:35.468 Copying "r:\Quality\_xyz_Data_\Out\Del_FTP.L" to remote directory started.
. 2008-08-29 07:52:35.468 Binary transfer mode selected.
. 2008-08-29 07:52:35.468 Opening remote file.
> 2008-08-29 07:52:35.468 Type: SSH_FXP_OPEN, Size: 55, Number: 259
< 2008-08-29 07:52:35.484 Type: SSH_FXP_HANDLE, Size: 13, Number: 259
> 2008-08-29 07:52:35.484 Type: SSH_FXP_WRITE, Size: 387, Number: 774
> 2008-08-29 07:52:35.484 Type: SSH_FXP_CLOSE, Size: 13, Number: 1028
> 2008-08-29 07:52:35.484 Type: SSH_FXP_SETSTAT, Size: 51, Number: 521
< 2008-08-29 07:52:35.515 Type: SSH_FXP_STATUS, Size: 24, Number: 774
< 2008-08-29 07:52:35.546 Type: SSH_FXP_STATUS, Size: 24, Number: 1028
< 2008-08-29 07:52:35.546 Status/error code: 0
< 2008-08-29 07:52:35.546 Type: SSH_FXP_STATUS, Size: 24, Number: 521
< 2008-08-29 07:52:35.546 Status/error code: 0
. 2008-08-29 07:52:35.546 Closing connection.
. 2008-08-29 07:52:35.546 Sending special code: 12
. 2008-08-29 07:52:35.546 Sent EOF message
First of all, thank you very much for this great tool that really does a great job!
STill I do have problem with a script which always returns errorlevel 1 although I can verify the put transfer has been completed successfull. Furthermore I can not see any problem within the output of winscp nor in the log file.
Any help is highly appreciated...
Thank youe very much!
Chris
Here is the Batch file (Win XP, SP2) that calls WinSCP.com (V416, Build 412):
If exist active_put.txt goto end
subst r: d:\xyz_Transfer
:start
START /W .\DTHRMNSS.EXE
CALL .\DTHRMNSS.BAT
copy put.ftp active_put.txt
echo ------------- >> Put_FTP.LOG
echo %DTHRMNSS% >> Put_FTP.LOG
echo ------------- >> Put_FTP.LOG
winscp.com /log=.\winscp.log /script=r:\Quality\put.ftp >> Put_FTP.LOG
if errorlevel 1 goto ERROR
:error
echo ******** error **** >> Put_FTP.LOG
del active_put.txt
goto end
:noerr
move /Y r:\Quality\_xyz_Data_\Out\*.* r:\Quality\_xyz_Data_\_Old\Out\
del active_put.txt
net use R: /delete
:end
The script put.ftp:
open -timeout=30 sftp://removed:password@10.0.0.1
cd Data
option transfer binary
option batch on
option confirm off
put -nopermissions r:\Quality\_xyz_Data_\Out\*.*
close
exit
Here is the output of the Winscp script:
-------------
29082008075213
-------------
Searching for host...
Connecting to host...
Authenticating...
Using username "removed".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] removed@10.0.0.1
/daten/company/Data
transfer binary
batch on
confirm off
r:\Quality\_xyz_Data_\Out\Del_FTP.L | 0 KiB | 0,0 KiB/s | binary | 100%
Session 'removed@10.0.0.1' closed.
No session.
And finally the WinSCP Log:
. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 WinSCP Version 4.1.6 (Build 412) (OS 5.1.2600 Service Pack 2)
. 2008-08-29 07:52:14.515 Login time: Freitag, 29. August 2008 07:52:14
. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 Session name: removed@10.0.0.1
. 2008-08-29 07:52:14.515 Host name: 10.0.0.1 (Port: 22)
. 2008-08-29 07:52:14.515 User name: removed (Password: Yes, Key file: No)
. 2008-08-29 07:52:14.515 Tunnel: No
. 2008-08-29 07:52:14.515 Transfer Protocol: SFTP
. 2008-08-29 07:52:14.515 Ping type: -, Ping interval: 30 sec; Timeout: 30 sec
. 2008-08-29 07:52:14.515 Proxy: none
. 2008-08-29 07:52:14.515 SSH protocol version: 2; Compression: No
. 2008-08-29 07:52:14.515 Bypass authentication: No
. 2008-08-29 07:52:14.515 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2008-08-29 07:52:14.515 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2008-08-29 07:52:14.515 SSH Bugs: -,-,-,-,-,-,-,-
. 2008-08-29 07:52:14.515 SFTP Bugs: -,-
. 2008-08-29 07:52:14.515 Return code variable: Autodetect; Lookup user groups: Yes
. 2008-08-29 07:52:14.515 Shell: default, EOL: 0
. 2008-08-29 07:52:14.515 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2008-08-29 07:52:14.515 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2008-08-29 07:52:14.515 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2008-08-29 07:52:14.515 Cache directory changes: Yes, Permanent: Yes
. 2008-08-29 07:52:14.515 DST mode: 1
. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 Looking up host "10.0.0.1"
. 2008-08-29 07:52:14.515 Connecting to 10.0.0.1 port 22
. 2008-08-29 07:52:14.578 Server version: SSH-2.0-OpenSSH_4.5
. 2008-08-29 07:52:14.578 We claim version: SSH-2.0-WinSCP_release_4.1.6
. 2008-08-29 07:52:14.578 SSPI: acquired credentials for: username@Domain
. 2008-08-29 07:52:14.578 Cannot convert IP address to SPN: DNS is not trusted
. 2008-08-29 07:52:14.578 GSSKEX disabled: Der Vorgang wurde erfolgreich beendet.. 2008-08-29 07:52:14.578 Using SSH protocol version 2
. 2008-08-29 07:52:14.609 Doing Diffie-Hellman group exchange
. 2008-08-29 07:52:14.718 Doing Diffie-Hellman key exchange with hash SHA-1
. 2008-08-29 07:52:15.062 Host key fingerprint is:
. 2008-08-29 07:52:15.062 ssh-rsa 2048 02:57:f9:53:6d:8a:cc:f7:5f:02:57:f9:53:6d:8a
. 2008-08-29 07:52:15.062 Initialised AES-256 SDCTR client->server encryption
. 2008-08-29 07:52:15.062 Initialised HMAC-SHA1 client->server MAC algorithm
. 2008-08-29 07:52:15.062 Initialised AES-256 SDCTR server->client encryption
. 2008-08-29 07:52:15.062 Initialised HMAC-SHA1 server->client MAC algorithm
! 2008-08-29 07:52:15.156 Using username "removed".
. 2008-08-29 07:52:35.218 Prompt (6, SSH password, , &Password: )
. 2008-08-29 07:52:35.218 Using stored password.
. 2008-08-29 07:52:35.218 Sent password
. 2008-08-29 07:52:35.250 Access granted
. 2008-08-29 07:52:35.296 Opened channel for session
. 2008-08-29 07:52:35.359 Started a shell/command
. 2008-08-29 07:52:35.359 --------------------------------------------------------------------------
. 2008-08-29 07:52:35.359 Using SFTP protocol.
. 2008-08-29 07:52:35.359 Doing startup conversation with host.
> 2008-08-29 07:52:35.375 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2008-08-29 07:52:35.406 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2008-08-29 07:52:35.406 SFTP version 3 negotiated.
. 2008-08-29 07:52:35.406 We believe the server has signed timestamps bug
. 2008-08-29 07:52:35.406 We will use UTF-8 strings for status messages only
. 2008-08-29 07:52:35.406 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2008-08-29 07:52:35.406 Getting current directory name.
. 2008-08-29 07:52:35.406 Getting real path for '.'
> 2008-08-29 07:52:35.406 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2008-08-29 07:52:35.437 Type: SSH_FXP_NAME, Size: 47, Number: 16
. 2008-08-29 07:52:35.437 Real path is '/daten/company'
. 2008-08-29 07:52:35.437 Startup conversation with host finished.
. 2008-08-29 07:52:35.437 Cached directory change via "removed" to "/daten/company/Data".
. 2008-08-29 07:52:35.437 Getting current directory name.
. 2008-08-29 07:52:35.437 Copying 1 files/directories to remote directory "/daten/company/Data"
. 2008-08-29 07:52:35.437 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 01; Resume: S (102400); CalcS: No; Mask:
. 2008-08-29 07:52:35.437 TM: B; ClAr: No; CPS: 0; ExclM(No):
. 2008-08-29 07:52:35.437 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2008-08-29 07:52:35.453 File: "r:\Quality\_xyz_Data_\Out\Del_FTP.L"
. 2008-08-29 07:52:35.468 Copying "r:\Quality\_xyz_Data_\Out\Del_FTP.L" to remote directory started.
. 2008-08-29 07:52:35.468 Binary transfer mode selected.
. 2008-08-29 07:52:35.468 Opening remote file.
> 2008-08-29 07:52:35.468 Type: SSH_FXP_OPEN, Size: 55, Number: 259
< 2008-08-29 07:52:35.484 Type: SSH_FXP_HANDLE, Size: 13, Number: 259
> 2008-08-29 07:52:35.484 Type: SSH_FXP_WRITE, Size: 387, Number: 774
> 2008-08-29 07:52:35.484 Type: SSH_FXP_CLOSE, Size: 13, Number: 1028
> 2008-08-29 07:52:35.484 Type: SSH_FXP_SETSTAT, Size: 51, Number: 521
< 2008-08-29 07:52:35.515 Type: SSH_FXP_STATUS, Size: 24, Number: 774
< 2008-08-29 07:52:35.546 Type: SSH_FXP_STATUS, Size: 24, Number: 1028
< 2008-08-29 07:52:35.546 Status/error code: 0
< 2008-08-29 07:52:35.546 Type: SSH_FXP_STATUS, Size: 24, Number: 521
< 2008-08-29 07:52:35.546 Status/error code: 0
. 2008-08-29 07:52:35.546 Closing connection.
. 2008-08-29 07:52:35.546 Sending special code: 12
. 2008-08-29 07:52:35.546 Sent EOF message