Quote:
Originally Posted by
kriss.gv
Hi R.Singh,
I would like to zip the files which are two weeks older from yesterday and remove the files which are 1 week older from yesterday.
Regards,
Kris
Hello Kris.gv,
So let's say you are running script once in a week either manually or by a scheduled method then most probably following may happen.
1st week ----> put all files more than 2 weeks to zip and remove all files which are older than 1 week.
2nd week ----> (As there shouldn't be any file older than 1 week) so it will not able to zip any files only it will delete files older than 1 week.
3rd week ----> Similarly as mentioned on second week as no file is ever reaching to modify date more than 2nd week so nothing will be zipped only 1 week older files will be deleted again.
So if you see only 1st week is effective here for zipping the files older than 2 weeks later each week it should only delete the files, so this applies if both zipping the files and deleting the files happens in same directory. So my question is, is it the same path or different paths where you want to perform these actions? Also if you have more conditions in this request kindly do mention them too.
Thanks,
R. Singh