M msok20 Verified User Joined Sep 22, 2020 Messages 36 Feb 10, 2021 #1 Hello, Can anybody help me help? I want to keep copies of the past two weeks. The backup is performed once on Sundays and is to be on the disk for the last two weeks. Can't use bash to delete script. The copy is to be overwritten. Regards
Hello, Can anybody help me help? I want to keep copies of the past two weeks. The backup is performed once on Sundays and is to be on the disk for the last two weeks. Can't use bash to delete script. The copy is to be overwritten. Regards
Zhenyapan Verified User Joined Feb 23, 2018 Messages 2,466 Location UA Feb 10, 2021 #2 You can use two cron jobs 30 1 1-7,15-21 * 6 /backup-to-dir1 30 1 8-14, 22-28 * 6 /backup-to-dir-2
M msok20 Verified User Joined Sep 22, 2020 Messages 36 Feb 11, 2021 #3 hmm but how to make for 3 weeks, add new cron? why 28 not 31? Thank you
Zhenyapan Verified User Joined Feb 23, 2018 Messages 2,466 Location UA Feb 11, 2021 #4 why 28 not 31? - because you can't divide 31/7. also because not every month has 31 day -- for 3 weeks use shell script to rotate backups.
why 28 not 31? - because you can't divide 31/7. also because not every month has 31 day -- for 3 weeks use shell script to rotate backups.