Upload all files except current date

Advertisement

fairudyn
Joined:
Posts:
6
Location:
Singapore

Upload all files except current date

Hi there, just needed help on how could I edit my script to upload all files in a local folder except for the ones created on the current date

So basically I would want to transfer all my backups over to our remote server but on a daily basis leaving 1 copy of backup that is created on that day itself.

lcd C:\WEBBACKUP
cd /WebBackup/178

put -delete -transfer=automatic "*.zip"

exit

Do you think if I changed it to this it will work?

lcd C:\WEBBACKUP
cd /WebBackup/178

put -transfer=automatic "*.zip" -filemask="*>=1D" *

exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: Upload all files except current date

If I understand your question correctly, then you have the condition otherway around.
It should be:

put *.zip -filemask="*<=1D" *

Reply with quote

fairudyn
Joined:
Posts:
6
Location:
Singapore

Re: Upload all files except current date

martin wrote:

If I understand your question correctly, then you have the condition otherway around.
It should be:

put *.zip -filemask="*<=1D" *

Hi Martin would this be correct if I choose to delete the rest except those created on the current date?

lcd C:\WEBBACKUP
cd /WebBackup/178

put -delete *.zip -filemask="*<=1D" *

exit

Reply with quote

martin
Site Admin
martin avatar

Re: Upload all files except current date

fairudyn wrote:

put -delete *.zip -filemask="*<=1D" *
This downloads and deletes all zip files created more than 24 hours ago.

Reply with quote

Advertisement

You can post new topics in this forum