reducing backup amounts parameterizing for later changes. should reduce cache sizes

This commit is contained in:
Andrew Davidson 2023-08-18 09:04:01 -07:00
parent c734a085e7
commit a406cfe849
Signed by: amd
SSH key fingerprint: SHA256:6jDSUhitcXG0Nrh/g8Gy8ZJdsZ5LzPJlaGmGKUGfP5k

View file

@ -181,23 +181,27 @@ else
;; ;;
"prune") "prune")
if [[ $AC_POWER == 1 ]]; then if [[ $AC_POWER == 1 ]]; then
hourly=6
daily=7
monthly=12
yearly=5
echo """ echo """
Pruning backups at $DESTINATION ... Pruning backups at $DESTINATION ...
Keeping: Keeping:
- 24 hourly backups - $hourly hourly backups
- 90 daily backups - $daily daily backups
- 12 monthly backups - $monthly monthly backups
- 5 yearly backups - $yearly yearly backups
""" | print_and_log """ | print_and_log
/usr/bin/restic \ RESTIC \
-r "$BACKUP_REPOSITORY" \ -r "$BACKUP_REPOSITORY" \
-p "$BACKUP_PASSWORD" \ -p "$BACKUP_PASSWORD" \
--verbose \ --verbose \
--prune \ --prune \
--keep-hourly=24 \ --keep-hourly=$hourly \
--keep-daily=90 \ --keep-daily=$daily \
--keep-monthly=12 \ --keep-monthly=$monthly \
--keep-yearly=5 \ --keep-yearly=$yearly \
forget | print_and_log forget | print_and_log
else else
echo "Not plugged in, canceling prune." echo "Not plugged in, canceling prune."