Support RESTIC_FORGET_ARGS

This commit is contained in:
Tobias Kaupat
2016-11-08 00:32:13 +01:00
parent 92a55b98b1
commit d3732519b9
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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