mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-04-03 19:58:50 +00:00
Support RESTIC_FORGET_ARGS
This commit is contained in:
@@ -17,6 +17,7 @@ ENV RESTIC_TAG=""
|
||||
ENV NFS_TARGET=""
|
||||
# By default backup every 6 hours
|
||||
ENV BACKUP_CRON="* */6 * * *"
|
||||
ENV RESTIC_FORGET_ARGS=""
|
||||
|
||||
# /data is the dir where you have to put the data to be backed up
|
||||
VOLUME /data
|
||||
|
||||
@@ -4,4 +4,7 @@ echo "Starting Backup"
|
||||
|
||||
restic backup /data --tag=${RESTIC_TAG?"Missing environment variable RESTIC_TAG"} >> /var/log/cron.log
|
||||
|
||||
|
||||
if [ -n "${RESTIC_FORGET_ARGS}" ]; then
|
||||
echo "Forget about old snapshots based on RESTIC_FORGET_ARGS = ${RESTIC_FORGET_ARGS}"
|
||||
restic forget ${RESTIC_FORGET_ARGS}
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user