Synchronize & Compare files only older than "X"

Advertisement

mike94
Joined:
Posts:
7
Location:
London

Synchronize & Compare files only older than "X"

Hi,

I know there are similar topic on the forum, but I can't seem to get it working they way I would like to have it.

Basically, I've got a WinSCP script implemented in Windows Task Scheduler, which connects to a remote directory and it copies all new files to a local directory, using the synchronize local feature. Back in a day it was a perfect and simple script, but now there are so many files in the local directory, so the script has to compare all of them and then download what is missing locally.

Is there a way to synchronize only the files which are older than "X" days, let's say 2 days ? By doing this the script would be executed every day as usual only copying the latest files, but thanks to "2 days parameter" it could also synchronize the files from the previous day in case they were skipped in the previous job.

I have placed the current version of the script below:
option batch abort
option confirm off
open sftp://******************:2222
synchronize local C:\test /mnt/backups
pause
The files which I'm backing up are the call recordings, and every day a new folder is created which has another sub folders inside of it. Maybe this could be used to apply the correct filemask and get the best outcome. The typical path looks something like below:

I hope it all makes sense.

Reply with quote

Advertisement

mike94
Joined:
Posts:
7
Location:
London

Re: Synchronize & Compare files only older than "X"

Hi Martin,

Thank you for your reply. The reason why I thought to download the files from the last two days is that everyday I'm executing the script in Windows Task Scheduler, and if for some reason one day the script does not get executed, next time it executes it will also download the missed call recordings from the previous day. It takes just a bit extra time to compare directories from two days rather than a single day, but it ensures failover should some files have not been downloaded previously.

Reply with quote

martin
Site Admin
martin avatar

Re: Synchronize & Compare files only older than "X"

I understand why you might want to download files from the last 2 days. But you have asked to download files older than 2 days.

Reply with quote

Advertisement

You can post new topics in this forum