Skip to content

Commit

Permalink
Add support for RESTIC_KEEP_YEARLY env var, with a default of 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmachine committed Dec 13, 2024
1 parent b98c2fd commit 37bd5fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ You can also pass the following environment variables to override the defaults:
-e RESTIC_KEEP_DAILY='7'
-e RESTIC_KEEP_WEEKLY='4'
-e RESTIC_KEEP_MONTHLY='12'
-e RESTIC_KEEP_YEARLY='7'

You can backup 5 different database clusters with `PG*_[1..5]`, and assign an arbitrary hostname with `HOSTNAME_[1..5]` (if `PGHOST` is not a fully qualified domain name) environment variables.

Expand Down
3 changes: 2 additions & 1 deletion bin/prune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ while ! restic forget \
--keep-hourly="${RESTIC_KEEP_HOURLY:-24}" \
--keep-daily="${RESTIC_KEEP_DAILY:-7}" \
--keep-weekly="${RESTIC_KEEP_WEEKLY:-4}" \
--keep-monthly="${RESTIC_KEEP_MONTHLY:-12}"; do
--keep-monthly="${RESTIC_KEEP_MONTHLY:-12}" \
--keep-yearly="${RESTIC_KEEP_YEARLY:-7}"; do
echo "Sleeping for 10 seconds before retry..."
sleep 10
done
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
# RESTIC_KEEP_DAILY: 7
# RESTIC_KEEP_WEEKLY: 4
# RESTIC_KEEP_MONTHLY: 12
# RESTIC_KEEP_YEARLY: 7
RESTIC_PASSWORD:
RESTIC_REPOSITORY:
image: interaction/restic-pg-dump
Expand Down

0 comments on commit 37bd5fe

Please sign in to comment.