'Resume' script option restarts fully downloaded files

Advertisement

hawa
Joined:
Posts:
2

'Resume' script option restarts fully downloaded files

WinSCP Versions: 5.1.4, 5.2 Beta
Windows Version: Windows 7 Professional SP1
Transfer Protocol: FTP

Script (file name is FTPBackup.txt):
option batch on
option confirm off
open user@FTPserver
get -resume /*.* C:\FTPBackup\

Command:
WinSCP.exe /console /script=C:\FTPBackup\FTPBackup.txt

Steps to Reproduce issue:
- Have several large files on server
- Let first few files download completely using above script
- Hit Ctrl+C to interrupt and terminate the batch transfer
- Re-run the same script to try completing the transfer

Expected Behavior:
Fully downloaded files are skipped, and partially downloaded file is resumed.

Observed Issue:
Fully downloaded files are downloaded from scratch again (instead of getting skipped).
Edit: Setting 'option batch continue' doesn't help either.

FYI, Partially downloaded file gets resumed as expected. If the last byte is removed, then just that byte is downloaded and WinSCP starts processing the next file as expected.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: 'Resume' script option restarts fully downloaded files

Although I understand this may be confusing, it is by design. I have updated documentation of get and put commands to make this clear.

Reply with quote

hawa

Re: 'Resume' script option restarts fully downloaded files

Thanks for the clarification.

Can you please suggest any other script commands or approach to achieve the expected behavior stated in the original post.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: 'Resume' script option restarts fully downloaded files

There's no easy solution.

Using Newer only together with -resume might do the job. But Newer only is not available in scripting directly, because synchronize replaces that. But synchronize does not allow resuming, as it would not make much any sense.

To get Newer only in scripting, see:
https://winscp.net/eng/docs/faq_script_ini

Reply with quote

Advertisement

You can post new topics in this forum