You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
666 B
Bash
25 lines
666 B
Bash
#!/bin/bash
|
|
|
|
# Run retention policy
|
|
|
|
if [ $RESTIC_CALENDAR_RETENTION = 'yes' ]; then
|
|
restic unlock
|
|
restic forget --prune --verbose \
|
|
--tag "${RESTIC_TAG_01}","${RESTIC_TAG_02}" \
|
|
--keep-daily "${RESTIC_RETENTION_DAYS}" \
|
|
--keep-weekly "${RESTIC_RETENTION_WEEKS}" \
|
|
--keep-monthly "${RESTIC_RETENTION_MONTHS}" \
|
|
--keep-yearly "${RESTIC_RETENTION_YEARS}"
|
|
restic unlock
|
|
fi
|
|
|
|
if [ $RESTIC_CALENDAR_RETENTION = 'no' ]; then
|
|
restic unlock
|
|
restic forget --prune --verbose \
|
|
--tag "${RESTIC_TAG_01}","${RESTIC_TAG_02}" \
|
|
--keep-last "${RESTIC_RETENTION_KEEP_LAST}"
|
|
restic unlock
|
|
fi
|
|
|
|
# Verify the repo's integrity
|
|
restic check --verbose |