Script not getting all files using the get command
Script using WinSCP.com logs onto ftp site, grabs whatever xml files are there to a local directory and then deletes them
This is the batch script
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=c:\temp\script.txt
here is the script.text
# Connect to SFTP server using a password
open wwwwwww:xxxxxxxxxxx.com -hostkey="ssh-rsa 2048 00:00:00:00:00:27:38......"
# Change remote directory
cd "directory567"
# Force binary mode transfer
option transfer binary
# Download file to the local directory
lcd "D:\share\new"
get *.xml
rm *.xml
# Disconnect
close
bye
This all works fine...in most cases.
I have had reports of some xml files not getting downloaded only deleted, i have an example of some below, this session had 5 xml files. only 2 files got copied from the remote server to the local and then deleted from the remote server, but 3 never got copied, they got only deleted, it shows in the error that
3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packet
. 2016-07-15 16:45:05.253 Copying 2 files/directories to local directory "D:\share\new"
. 2016-07-15 16:45:05.253 File: '/directory567/12345.xml' [2016-07-15T06:45:04.000Z] [1727]
. 2016-07-15 16:45:05.253 Copying "/directory567/12345.xml" to local directory started.
. 2016-07-15 16:45:05.253 Binary transfer mode selected.
. 2016-07-15 16:45:05.253 Opening remote file.
> 2016-07-15 16:45:05.253 Type: SSH_FXP_OPEN, Size: 43, Number: 1283
< 2016-07-15 16:45:05.409 Type: SSH_FXP_STATUS, Size: 24, Number: 1028
. 2016-07-15 16:45:05.409 Discarding reserved response
< 2016-07-15 16:45:05.550 Type: SSH_FXP_HANDLE, Size: 25, Number: 1283
> 2016-07-15 16:45:05.550 Type: SSH_FXP_FSTAT, Size: 25, Number: 1544
< 2016-07-15 16:45:05.706 Type: SSH_FXP_ATTRS, Size: 37, Number: 1544
> 2016-07-15 16:45:05.706 Type: SSH_FXP_READ, Size: 37, Number: 1797
< 2016-07-15 16:45:06.018 Status code: 1
. 2016-07-15 16:45:06.018 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packet
> 2016-07-15 16:45:06.018 Type: SSH_FXP_CLOSE, Size: 25, Number: 2308
. 2016-07-15 16:45:06.018 Preserving timestamp [2016-07-15T06:45:04.000Z]
. 2016-07-15 16:45:06.018 Transfer done: '/directory567/12345.xml' [1727]
. 2016-07-15 16:45:06.018 File: '/directory567/123456.xml' [2016-07-15T06:45:05.000Z] [1727]
. 2016-07-15 16:45:06.018 Copying "/directory567/123456.xml" to local directory started.
. 2016-07-15 16:45:06.018 Binary transfer mode selected.
. 2016-07-15 16:45:06.018 Opening remote file.
> 2016-07-15 16:45:06.018 Type: SSH_FXP_OPEN, Size: 43, Number: 2563
< 2016-07-15 16:45:06.174 Type: SSH_FXP_STATUS, Size: 24, Number: 2308
. 2016-07-15 16:45:06.174 Discarding reserved response
< 2016-07-15 16:45:06.314 Type: SSH_FXP_HANDLE, Size: 25, Number: 2563
> 2016-07-15 16:45:06.314 Type: SSH_FXP_FSTAT, Size: 25, Number: 2824
< 2016-07-15 16:45:06.470 Type: SSH_FXP_ATTRS, Size: 37, Number: 2824
> 2016-07-15 16:45:06.470 Type: SSH_FXP_READ, Size: 37, Number: 3077
< 2016-07-15 16:45:06.782 Status code: 1
. 2016-07-15 16:45:06.782 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2016-07-15 16:45:06.782 Type: SSH_FXP_CLOSE, Size: 25, Number: 3588
. 2016-07-15 16:45:06.782 Preserving timestamp [2016-07-15T06:45:05.000Z]
. 2016-07-15 16:45:06.782 Transfer done: '/directory567/103396.xml' [1727]
> 2016-07-15 16:45:06.782 Script: rm *.xml
here is one of the 2 that did get downloaded and then removed.
. 2016-07-15 16:45:05.253 12345678.xml;-;1727;2016-07-15T06:45:04.000Z;"blahblah" [19344];rw-rw----;0
. 2016-07-15 16:45:05.253 File: '/directory567/12345678.xml' [2016-07-15T06:45:04.000Z] [1727]
. 2016-07-15 16:45:05.253 Copying "/directory567/12345678.xml" to local directory started.
. 2016-07-15 16:45:06.018 Transfer done: '/directory567/12345678.xml' [1727]
. 2016-07-15 16:45:07.391 12345678.xml;-;1727;2016-07-15T06:45:04.000Z;"" [19344];rw-rw----;0
. 2016-07-15 16:45:07.703 Deleting file "12345678.xml".
. 2016-07-15 16:45:07.859 Script: 12345678.xml
Here is one of the 3 files that never made it, only deleted
. 2016-07-15 16:45:07.391 1234567.xml;-;1723;2016-07-15T06:45:06.000Z;"blahblah" [19344];rw-rw----;0
. 2016-07-15 16:45:07.391 Deleting file "1234567.xml".
. 2016-07-15 16:45:07.703 Script: 1234567.xml
Any help would be very much approciated. Do I need to put additional paramaters in the script or os this a setting on the remote server?
This is the batch script
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=c:\temp\script.txt
here is the script.text
# Connect to SFTP server using a password
open wwwwwww:xxxxxxxxxxx.com -hostkey="ssh-rsa 2048 00:00:00:00:00:27:38......"
# Change remote directory
cd "directory567"
# Force binary mode transfer
option transfer binary
# Download file to the local directory
lcd "D:\share\new"
get *.xml
rm *.xml
# Disconnect
close
bye
This all works fine...in most cases.
I have had reports of some xml files not getting downloaded only deleted, i have an example of some below, this session had 5 xml files. only 2 files got copied from the remote server to the local and then deleted from the remote server, but 3 never got copied, they got only deleted, it shows in the error that
3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packet
. 2016-07-15 16:45:05.253 Copying 2 files/directories to local directory "D:\share\new"
. 2016-07-15 16:45:05.253 File: '/directory567/12345.xml' [2016-07-15T06:45:04.000Z] [1727]
. 2016-07-15 16:45:05.253 Copying "/directory567/12345.xml" to local directory started.
. 2016-07-15 16:45:05.253 Binary transfer mode selected.
. 2016-07-15 16:45:05.253 Opening remote file.
> 2016-07-15 16:45:05.253 Type: SSH_FXP_OPEN, Size: 43, Number: 1283
< 2016-07-15 16:45:05.409 Type: SSH_FXP_STATUS, Size: 24, Number: 1028
. 2016-07-15 16:45:05.409 Discarding reserved response
< 2016-07-15 16:45:05.550 Type: SSH_FXP_HANDLE, Size: 25, Number: 1283
> 2016-07-15 16:45:05.550 Type: SSH_FXP_FSTAT, Size: 25, Number: 1544
< 2016-07-15 16:45:05.706 Type: SSH_FXP_ATTRS, Size: 37, Number: 1544
> 2016-07-15 16:45:05.706 Type: SSH_FXP_READ, Size: 37, Number: 1797
< 2016-07-15 16:45:06.018 Status code: 1
. 2016-07-15 16:45:06.018 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packet
> 2016-07-15 16:45:06.018 Type: SSH_FXP_CLOSE, Size: 25, Number: 2308
. 2016-07-15 16:45:06.018 Preserving timestamp [2016-07-15T06:45:04.000Z]
. 2016-07-15 16:45:06.018 Transfer done: '/directory567/12345.xml' [1727]
. 2016-07-15 16:45:06.018 File: '/directory567/123456.xml' [2016-07-15T06:45:05.000Z] [1727]
. 2016-07-15 16:45:06.018 Copying "/directory567/123456.xml" to local directory started.
. 2016-07-15 16:45:06.018 Binary transfer mode selected.
. 2016-07-15 16:45:06.018 Opening remote file.
> 2016-07-15 16:45:06.018 Type: SSH_FXP_OPEN, Size: 43, Number: 2563
< 2016-07-15 16:45:06.174 Type: SSH_FXP_STATUS, Size: 24, Number: 2308
. 2016-07-15 16:45:06.174 Discarding reserved response
< 2016-07-15 16:45:06.314 Type: SSH_FXP_HANDLE, Size: 25, Number: 2563
> 2016-07-15 16:45:06.314 Type: SSH_FXP_FSTAT, Size: 25, Number: 2824
< 2016-07-15 16:45:06.470 Type: SSH_FXP_ATTRS, Size: 37, Number: 2824
> 2016-07-15 16:45:06.470 Type: SSH_FXP_READ, Size: 37, Number: 3077
< 2016-07-15 16:45:06.782 Status code: 1
. 2016-07-15 16:45:06.782 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2016-07-15 16:45:06.782 Type: SSH_FXP_CLOSE, Size: 25, Number: 3588
. 2016-07-15 16:45:06.782 Preserving timestamp [2016-07-15T06:45:05.000Z]
. 2016-07-15 16:45:06.782 Transfer done: '/directory567/103396.xml' [1727]
> 2016-07-15 16:45:06.782 Script: rm *.xml
here is one of the 2 that did get downloaded and then removed.
. 2016-07-15 16:45:05.253 12345678.xml;-;1727;2016-07-15T06:45:04.000Z;"blahblah" [19344];rw-rw----;0
. 2016-07-15 16:45:05.253 File: '/directory567/12345678.xml' [2016-07-15T06:45:04.000Z] [1727]
. 2016-07-15 16:45:05.253 Copying "/directory567/12345678.xml" to local directory started.
. 2016-07-15 16:45:06.018 Transfer done: '/directory567/12345678.xml' [1727]
. 2016-07-15 16:45:07.391 12345678.xml;-;1727;2016-07-15T06:45:04.000Z;"" [19344];rw-rw----;0
. 2016-07-15 16:45:07.703 Deleting file "12345678.xml".
. 2016-07-15 16:45:07.859 Script: 12345678.xml
Here is one of the 3 files that never made it, only deleted
. 2016-07-15 16:45:07.391 1234567.xml;-;1723;2016-07-15T06:45:06.000Z;"blahblah" [19344];rw-rw----;0
. 2016-07-15 16:45:07.391 Deleting file "1234567.xml".
. 2016-07-15 16:45:07.703 Script: 1234567.xml
Any help would be very much approciated. Do I need to put additional paramaters in the script or os this a setting on the remote server?