Hi. I have a requirement where files can be uploaded to the SFTP server at any time. I need to download the oldest file (First In First Out) from the SFTP server and load it in the database. I am using WinSCP command line script for this. Can someone please help me out here? I saw that there is a way to get the latest file using command line but nothing for oldest. Appreciate the help. Thanks.
See the script for downloading the most recent file:
And just remove the
-Descendingswitch from the