Uploading all files in a folder in order

Advertisement

ademkiv
Guest

Uploading all files in a folder in order

I have a process that will generate anywhere between 5 and 17 files nightly. These files will have to be uploaded in a certain order. Since I cannot predict which files will be generated nightly I have hard time figuring out how to write a script to upload files in correct order. In what order, by default, does WinSCP upload files? Does it use timestamps and go in ascending order?

What would happen if I have a command in the script to upload a file that doesn't exist? Will the whole process fail?

Thanks for the help!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Uploading all files in a folder in order

WinSCP uploads the files in the order in which they are returned by Windows in the directory listing (so its in-deterministic).

By default the script fails when the file does not exist.
You can change this with option batch command:
https://winscp.net/eng/docs/scriptcommand_option

Reply with quote

Advertisement

You can post new topics in this forum