Automation: Get -delete function on multiple files

Advertisement

Automation
Guest

Automation: Get -delete function on multiple files

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?

Reply with quote

Advertisement

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

Re: Automation: Get -delete function on multiple files

It dowloads the first file, deletes the first file, downloads the second file, deletes the second file, and so on.

Reply with quote

nit
Guest

Re: Automation: Get -delete function on multiple files

martin wrote:

It dowloads the first file, deletes the first file, downloads the second file, deletes the second file, and so on.


Hey, how can we do this with .net assembly...download one file , delete it and then download another etc

Reply with quote

Advertisement

nit
Guest

Thanks Martin..

Currently i am using GetFiles with remove set to zero. I have around 20000 files to download and delete. If i change to true for remove , will it have any impact on performance, ie, on the time taken to download these files

Reply with quote

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

nit wrote:

Thanks Martin..

Currently i am using GetFiles with remove set to zero. I have around 20000 files to download and delete. If i change to true for remove , will it have any impact on performance, ie, on the time taken to download these files
Well, the deleting takes some time. But I cannot quantify that, as it depends primarily on the server.

If those files are small, the deleting can take as long as the download itself. If the files are large, the deleting would typically be negligible comparing to the download.

Reply with quote

Advertisement

You can post new topics in this forum