You’re right @ProactiveServices. You and @764287 convinced me to try the full automation.
I’m new to bash scripting so if you have the time: did I do the right thing with the &&
in the crontab
?
I chained restic check --read-data && restic forget --prune && restic check
#
# weekly LOCAL backup and check every Monday at 2:53 am (using variables in .restic-env-local)
53 2 * * 1 . /home/flea/.restic-env-local; /usr/bin/restic backup /zpool/Silo/; /usr/bin/restic check
#
# weekly OFFSITE backup and check to B2 on every Tuesday at 2:23 am (using variables in .restic-env)
23 2 * * 2 . /home/flea/.restic-env; /usr/bin/restic backup /zpool/Silo/; /usr/bin/restic check
#
# monthly full check of LOCAL backup on the first Wednesday of every month at 2:23 am (using variables in .restic-env-local)
23 2 1-7 * * if [ `date +\%u` = 3 ]; then . /home/flea/.restic-env-local; /usr/bin/restic check --read-data && /usr/bin/restic forget -H 24 -d 7 -w 8 -m 24 --prune && /usr/bin/restic check; fi
#
# monthly full check OFFSITE on the second Wednesday of every other month at 2:23 am (using variables in .restic-env)
23 2 8-14 * * if [ `date +\%u` = 3 ]; then . /home/flea/.restic-env; /usr/bin/restic check --read-data && /usr/bin/restic forget -H 24 -d 7 -w 8 -m 24 --prune && /usr/bin/restic check; fi