Re: Get oldest file from SFTP server
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:
https://winscp.net/eng/docs/script_download_most_recent_file
And just remove the
-Descending
switch from the Sort-Object
cmdlet.