Topic "Automation: Get -delete function on multiple files"

Author Message
Automation

Guest


I have script today that pulls all files off an SFTP folder down to a local drive. A request has been made to have the files deleted after download. I have read the help and I see that the get -delete function should do exactly what I want, however I do not see how this operation works when the get is pulling multiple files.

Today the command is:
get /In/*ABC* C:\Files\In\

So, in theory, I can change that to:
get -delete /In/*ABC* C:\Files\In\

But, will the job delete each file as it is downloaded, might it delete files it has yet to download, or will it wait until the last file is downloaded to start deleting? The only other way I see to do this is to leave the original get in place, exit the connection, read the files in the C:\Files\In\ folder, then delete each of the files specifically by name.

Thoughts?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
It dowloads the first file, deletes the first file, downloads the second file, deletes the second file, and so on.
_________________
Martin Prikryl
Automation

Guest


Thanks for the response.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License