Topic "Download Files from a folder with a dynamic name each day"

Author Message
mspiegel@...

Guest


I'm looking for help with writing the proper syntax to download files from a folder on a FTP site that is stored in folders by date.

The folder structure is as follows:

03212016
03222016
03232016
03242016

The files inside of each folder have a date/time stamp of the calendar day that follows. i.e. folder 03212016 has files with a date/time stamp of 03222016hhmmss



What's the proper script to write to automate the process so I can have WinSCP download the files from the correct folder each day?

Thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Use get %TIMESTAMP#yyyymmdd%/*

See http://winscp.net/eng/docs/scripting#timestamp
mspiegel@...

Guest


How do you get that to work for a previous day to select a directory? So if I logged onto the FTP site right now the most recent directory is 03302016 and the files inside of that directory have a date/time stamp of today.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
For that, the %TIMESTAMP% syntax does not help.

See this article for all the options you have:
http://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