Topic "Transfer New Log file Every Morning"

Author Message
AtomicX

Guest


Hey guys, everyday I have a server that has a log file made every day, the log file has a name such as log_20130702 and log_20130703 etc etc. What I want to do is every morning take the log file from the previous day (I.E. if today is July 3rd, take the log from July 2) and throw it in a FTP server. I would want this to be done automatically. How would I accomplish this?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
For scripting and scheduling in general, start here:
http://winscp.net/eng/docs/guide_automation
http://winscp.net/eng/docs/guide_schedule

To select the yesterdays file only:
If you can rely on a relative time between creation of the log and run of the script, you can do with simple file mask with time interval constraint, like:
Code:
put *>1d

See http://winscp.net/eng/docs/file_mask

For other (more exact, but also more complicated) solutions see:
http://winscp.net/eng/docs/script_download_most_recent_file
http://winscp.net/eng/docs/script_download_timestamped_filename
_________________
Martin Prikryl
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