Backup problem cron

msok20

Verified User
Joined
Sep 22, 2020
Messages
36
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
 
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
 
hmm but how to make for 3 weeks, add new cron?

why 28 not 31?

Thank you
 
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.
 
Back
Top