Unable to transfer file using script

Advertisement

michael_v
Joined:
Posts:
1
Location:
South Africa

Unable to transfer file using script

I have a script that runs at night to transfer files via SFTP, the log displays that the file has been transferred but when I log into the FTP site it shows the old files from the previous transfer, however when I login and transfer via the winscp console it transfers the files. I have attached the log from the transfer.

. 2017-06-20 01:00:05.754 WinSCP Version 5.9.5 (Build 7441) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Standard)
. 2017-06-20 01:00:05.754 Configuration: nul
. 2017-06-20 01:00:05.754 Log level: Normal
. 2017-06-20 01:00:05.754 Local account:xxxxxxxxx\xxxxxxxxxx
. 2017-06-20 01:00:05.754 Working directory: C:\Windows\system32
. 2017-06-20 01:00:05.754 Process ID: 4792
. 2017-06-20 01:00:05.754 Command-line: "D:\WinSCP\WinSCP.exe" /log="D:\Winscp\Log\WinSCPdaily.log" /ini=nul /script="D:\WINSCP\Scripts\xxxxxxxxxx.bat"
. 2017-06-20 01:00:05.754 Time zone: Current: GMT+2 (South Africa Standard Time), No DST
. 2017-06-20 01:00:05.754 Login time: 20 June 2017 01:00:05 AM
. 2017-06-20 01:00:05.754 --------------------------------------------------------------------------
. 2017-06-20 01:00:05.754 Script: Retrospectively logging previous script records:
> 2017-06-20 01:00:05.754 Script: echo on
< 2017-06-20 01:00:05.754 Script: on
> 2017-06-20 01:00:05.754 Script: open xxxxxxxxxxxxxxx --------------------------------------------------------------------------
. 2017-06-20 01:00:05.754 Session name: xxxxxxxxxxxxxxxx (Ad-Hoc site)
. 2017-06-20 01:00:05.754 Host name: xxxxxxxxxxxxxxxx (Port: 22)
. 2017-06-20 01:00:05.754 User name: xxxxxxxxxxxxxxxx (Password: Yes, Key file: No, Passphrase: No)
. 2017-06-20 01:00:05.754 Tunnel: No
. 2017-06-20 01:00:05.754 Transfer Protocol: SFTP
. 2017-06-20 01:00:05.754 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2017-06-20 01:00:05.754 Disable Nagle: No
. 2017-06-20 01:00:05.754 Proxy: None
. 2017-06-20 01:00:05.754 Send buffer: 262144
. 2017-06-20 01:00:05.754 SSH protocol version: 2; Compression: No
. 2017-06-20 01:00:05.754 Bypass authentication: No
. 2017-06-20 01:00:05.754 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2017-06-20 01:00:05.754 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2017-06-20 01:00:05.754 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2017-06-20 01:00:05.754 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2017-06-20 01:00:05.754 Simple channel: Yes
. 2017-06-20 01:00:05.754 Return code variable: Autodetect; Lookup user groups: Auto
. 2017-06-20 01:00:05.754 Shell: default
. 2017-06-20 01:00:05.754 EOL: LF, UTF: Auto
. 2017-06-20 01:00:05.754 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2017-06-20 01:00:05.754 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2017-06-20 01:00:05.754 SFTP Bugs: Auto,Auto
. 2017-06-20 01:00:05.754 SFTP Server: default
. 2017-06-20 01:00:05.754 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2017-06-20 01:00:05.754 Cache directory changes: Yes, Permanent: Yes
. 2017-06-20 01:00:05.754 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2017-06-20 01:00:05.754 DST mode: Unix
. 2017-06-20 01:00:05.754 --------------------------------------------------------------------------
. 2017-06-20 01:00:05.754 Looking up host "xxxxxxxxxxxx" for SSH connection
. 2017-06-20 01:00:05.817 Connecting to xxxxxxxxx port 22
. 2017-06-20 01:00:05.832 We claim version: SSH-2.0-WinSCP_release_5.9.5
. 2017-06-20 01:00:05.848 Server version: SSH-2.0-1.36_sshlib GlobalSCAPE
. 2017-06-20 01:00:05.848 We believe remote version ignores SSH-2 maximum packet size
. 2017-06-20 01:00:05.848 We believe remote version has SSH-2 channel request bug
. 2017-06-20 01:00:05.848 Using SSH protocol version 2
. 2017-06-20 01:00:05.848 Have a known host key of type rsa2
. 2017-06-20 01:00:05.848 Doing Diffie-Hellman group exchange
. 2017-06-20 01:00:06.066 Doing Diffie-Hellman key exchange with hash SHA-1
. 2017-06-20 01:00:06.347 Host key fingerprint is:
. 2017-06-20 01:00:06.347 ssh-rsa 2048 xxxxxxxxxxxxxx
. 2017-06-20 01:00:06.347 Host key matches configured key
. 2017-06-20 01:00:06.347 Initialised AES-256 CBC client->server encryption
. 2017-06-20 01:00:06.347 Initialised HMAC-SHA1 client->server MAC algorithm
. 2017-06-20 01:00:06.347 Initialised AES-256 CBC server->client encryption
. 2017-06-20 01:00:06.347 Initialised HMAC-SHA1 server->client MAC algorithm
! 2017-06-20 01:00:06.565 Using username "xxxxxxxxxxxxxx".
. 2017-06-20 01:00:06.581 Server offered these authentication methods: password,keyboard-interactive
. 2017-06-20 01:00:06.581 Attempting keyboard-interactive authentication
. 2017-06-20 01:00:06.597 Prompt (keyboard interactive, "SSH server authentication", "Using keyboard-interactive authentication.", "Enter password: ")
. 2017-06-20 01:00:06.597 Using stored password.
. 2017-06-20 01:00:06.597 Access granted
. 2017-06-20 01:00:06.597 Opening session as main channel
. 2017-06-20 01:00:06.612 Opened main channel
. 2017-06-20 01:00:06.815 Started a shell/command
. 2017-06-20 01:00:06.815 --------------------------------------------------------------------------
. 2017-06-20 01:00:06.815 Using SFTP protocol.
. 2017-06-20 01:00:06.815 Doing startup conversation with host.
> 2017-06-20 01:00:06.815 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2017-06-20 01:00:06.831 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2017-06-20 01:00:06.831 SFTP version 3 negotiated.
. 2017-06-20 01:00:06.831 We believe the server has signed timestamps bug
. 2017-06-20 01:00:06.831 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2017-06-20 01:00:06.831 Getting current directory name.
. 2017-06-20 01:00:06.831 Getting real path for '.'
> 2017-06-20 01:00:06.831 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2017-06-20 01:00:06.846 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2017-06-20 01:00:06.846 Real path is '/'
. 2017-06-20 01:00:06.846 Startup conversation with host finished.
< 2017-06-20 01:00:06.846 Script: Active session: [1]
> 2017-06-20 01:00:06.846 Script: option transfer binary
< 2017-06-20 01:00:06.846 Script: transfer binary
> 2017-06-20 01:00:06.846 Script: put "D:\xxxxxxxxx\xxxxxxx\xxxxxxxxxxxs\*"
. 2017-06-20 01:00:06.846 Copying 4 files/directories to remote directory "/"
. 2017-06-20 01:00:06.846 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask:
. 2017-06-20 01:00:06.846 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2017-06-20 01:00:06.846 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2017-06-20 01:00:06.846 File: 'D:\xxxxxxxx\xxxxxxxxxx\xxxxxxxxxx\xxxxxxx.zip' [2017-06-19T20:03:38.946Z] [35343]
. 2017-06-20 01:00:06.846 Copying "D:\xxx\xxxx\xxxx.zip" to remote directory started.
. 2017-06-20 01:00:06.846 Binary transfer mode selected.
. 2017-06-20 01:00:06.846 Opening remote file.
> 2017-06-20 01:00:06.846 Type: SSH_FXP_OPEN, Size: 40, Number: 259
< 2017-06-20 01:00:06.846 Type: SSH_FXP_HANDLE, Size: 10, Number: 259
> 2017-06-20 01:00:06.862 Type: SSH_FXP_WRITE, Size: 32790, Number: 774
. 2017-06-20 01:00:06.862 1 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2017-06-20 01:00:06.862 Type: SSH_FXP_CLOSE, Size: 10, Number: 1284
> 2017-06-20 01:00:06.862 Type: SSH_FXP_SETSTAT, Size: 36, Number: 521
< 2017-06-20 01:00:06.909 Type: SSH_FXP_STATUS, Size: 21, Number: 774
< 2017-06-20 01:00:06.909 Type: SSH_FXP_STATUS, Size: 21, Number: 1030
< 2017-06-20 01:00:06.909 Type: SSH_FXP_STATUS, Size: 21, Number: 1284
< 2017-06-20 01:00:06.909 Status code: 0
. 2017-06-20 01:00:06.909 Preserving timestamp [2017-06-19T20:03:38.000Z]
< 2017-06-20 01:00:06.909 Type: SSH_FXP_STATUS, Size: 21, Number: 521
< 2017-06-20 01:00:06.909 Status code: 0
. 2017-06-20 01:00:06.909 Transfer done: 'D:\xxxx\xxxxx\xxxxxxx.zip' [35343]
. 2017-06-20 01:00:06.909 File: 'D:\xxxx\xxxxx\xxxxxxx.zip' [2017-06-19T20:03:39.121Z] [6889]
. 2017-06-20 01:00:06.909 Copying "D:\xxxxxx\xxxxxxx\xxxxxxx.zip" to remote directory started.
. 2017-06-20 01:00:06.909 Binary transfer mode selected.
. 2017-06-20 01:00:06.909 Opening remote file.
> 2017-06-20 01:00:06.909 Type: SSH_FXP_OPEN, Size: 40, Number: 1539
< 2017-06-20 01:00:06.909 Type: SSH_FXP_HANDLE, Size: 10, Number: 1539
> 2017-06-20 01:00:06.940 Type: SSH_FXP_WRITE, Size: 6911, Number: 2054
> 2017-06-20 01:00:06.940 Type: SSH_FXP_CLOSE, Size: 10, Number: 2308
> 2017-06-20 01:00:06.940 Type: SSH_FXP_SETSTAT, Size: 36, Number: 1801
< 2017-06-20 01:00:06.955 Type: SSH_FXP_STATUS, Size: 21, Number: 2054
< 2017-06-20 01:00:06.955 Type: SSH_FXP_STATUS, Size: 21, Number: 2308
< 2017-06-20 01:00:06.955 Status code: 0
. 2017-06-20 01:00:06.955 Preserving timestamp [2017-06-19T20:03:39.000Z]
< 2017-06-20 01:00:06.955 Type: SSH_FXP_STATUS, Size: 21, Number: 1801
< 2017-06-20 01:00:06.955 Status code: 0
. 2017-06-20 01:00:06.955 Transfer done: 'D:\xxxxxxxxxx\xxxxxxxx\xxxxxx.zip' [6889]
. 2017-06-20 01:00:06.955 File: 'D:\xxxxxxxxx\xxxxxxxxx\xxxxxxx.zip' [2017-06-19T20:03:39.476Z] [37032]
. 2017-06-20 01:00:06.955 Copying "D:\xxxxxxxx\xxxxxxxx\xxxxxxx.zip" to remote directory started.
. 2017-06-20 01:00:06.955 Binary transfer mode selected.
. 2017-06-20 01:00:06.955 Opening remote file.
> 2017-06-20 01:00:06.955 Type: SSH_FXP_OPEN, Size: 40, Number: 2563
< 2017-06-20 01:00:06.971 Type: SSH_FXP_HANDLE, Size: 10, Number: 2563
> 2017-06-20 01:00:07.033 Type: SSH_FXP_WRITE, Size: 35836, Number: 3078
. 2017-06-20 01:00:07.033 1 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2017-06-20 01:00:07.033 Type: SSH_FXP_CLOSE, Size: 10, Number: 3588
> 2017-06-20 01:00:07.033 Type: SSH_FXP_SETSTAT, Size: 36, Number: 2825
< 2017-06-20 01:00:07.049 Type: SSH_FXP_STATUS, Size: 21, Number: 3078
< 2017-06-20 01:00:07.049 Type: SSH_FXP_STATUS, Size: 21, Number: 3334
< 2017-06-20 01:00:07.049 Type: SSH_FXP_STATUS, Size: 21, Number: 3588
< 2017-06-20 01:00:07.049 Status code: 0
. 2017-06-20 01:00:07.049 Preserving timestamp [2017-06-19T20:03:39.000Z]
< 2017-06-20 01:00:07.049 Type: SSH_FXP_STATUS, Size: 21, Number: 2825
< 2017-06-20 01:00:07.049 Status code: 0
. 2017-06-20 01:00:07.049 Transfer done: 'D:\xxxxxxxx\xxxxxxxxx\xxxxxx\xxxxxxxx.zip' [37032]
. 2017-06-20 01:00:07.049 File: 'D:\xxxxxxx\xxxxxxx\xxxxxxx\xxxxx.zip' [2017-06-19T20:03:39.743Z] [6675]
. 2017-06-20 01:00:07.049 Copying "D:\xxxxxxx\xxxxxxx\xxxxxxx\xxxxx.zip" to remote directory started.
. 2017-06-20 01:00:07.049 Binary transfer mode selected.
. 2017-06-20 01:00:07.049 Opening remote file.
> 2017-06-20 01:00:07.049 Type: SSH_FXP_OPEN, Size: 40, Number: 3843
< 2017-06-20 01:00:07.049 Type: SSH_FXP_HANDLE, Size: 10, Number: 3843
> 2017-06-20 01:00:07.111 Type: SSH_FXP_WRITE, Size: 6697, Number: 4358
> 2017-06-20 01:00:07.111 Type: SSH_FXP_CLOSE, Size: 10, Number: 4612
> 2017-06-20 01:00:07.111 Type: SSH_FXP_SETSTAT, Size: 36, Number: 4105
< 2017-06-20 01:00:07.111 Type: SSH_FXP_STATUS, Size: 21, Number: 4358
< 2017-06-20 01:00:07.127 Type: SSH_FXP_STATUS, Size: 21, Number: 4612
< 2017-06-20 01:00:07.127 Status code: 0
. 2017-06-20 01:00:07.127 Preserving timestamp [2017-06-19T20:03:39.000Z]
< 2017-06-20 01:00:07.127 Type: SSH_FXP_STATUS, Size: 21, Number: 4105
< 2017-06-20 01:00:07.127 Status code: 0
. 2017-06-20 01:00:07.127 Transfer done: 'D:\xxxxxx\xxxxxxx\xxxxxxx\xxxx.zip' [6675]
> 2017-06-20 01:00:07.127 Script: exit
. 2017-06-20 01:00:07.127 Script: Exit code: 0
. 2017-06-20 01:00:07.127 Closing connection.
. 2017-06-20 01:00:07.127 Sending special code: 12
. 2017-06-20 01:00:07.127 Sent EOF message

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,542
Location:
Prague, Czechia

Re: Unable to transfer file using script

Please, add ls command to the end of the script and show us a new log file without obfuscating the filenames.

And also a log file of "log into the FTP site it shows the old files from the previous transfer".

Reply with quote

Advertisement

You can post new topics in this forum