Topic "get -latest based on current date"

Author Message
RBlakeney
[View user's profile]

Joined: 2016-12-02
Posts: 1
Location: UK
Using VBA, I have a script which grabs the latest file from the server. It uses a wildcard to grab the correct titled file and the get - latest pulls the most recent.

I need to expand this so that it only pulls the latest file with the current days timestamp.

This is so that on the next day, it doesn't grab one of the files that would have been grabbed yesterday if a newer file has not been created on the server. Yesterdays file have been processed and removed locally and we do not want them processing again.

I assume I need to something like this but am unsure of the syntax:

- Get todays date
- Get the latest file with todays timestamp

Any ideas?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
get -latest * -filemask=*>=%TIMESTAMP#yyyy-mm-dd%

https://winscp.net/eng/docs/file_mask
https://winscp.net/eng/docs/scripting#timestamp
https://winscp.net/eng/docs/script_download_most_recent_file
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