Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Downloading only new files from a remote dir

Let me know if it helps.
martin

Re: Downloading only new files from a remote dir

This seems as too complex task for the simple scripting functionality of WinSCP.
However, what about:
option batch abort

get *
rm *

This would remove the files, if "get" succeeds, only.
Then you can run another script like:
mv * to_some_back_up_dir/

To backup files that failed to download.
You can do that, if the first script returns error code, only.
hmir

Downloading only new files from a remote dir

I need some help writing a script that would download any files from a remote dir and after download, delete them from remote dir. I know how to download and delete a remote file via script. The problem is that I only want to delete those files that have been downloaded successfully. If I was writing a unix shell script I know, I would read the list of files in a given dir, then using a foreach type loop, download each file at a time and then delete it if download was successful. I looked into synchronize command but that's not what I want to do. How can I accomplish this via WinSCP script. I would schedule this script using Windows Scheduler.

Any help. Thanks a lot.