add init args env variable

This commit is contained in:
0chroma
2021-12-16 02:55:10 -08:00
committed by Tobias Kaupat
parent 36f771b781
commit e94df72518
2 changed files with 4 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ ENV RESTIC_PASSWORD=""
ENV RESTIC_TAG=""
ENV NFS_TARGET=""
ENV BACKUP_CRON="0 */6 * * *"
ENV RESTIC_INIT_ARGS=""
ENV RESTIC_FORGET_ARGS=""
ENV RESTIC_JOB_ARGS=""
ENV MAILX_ARGS=""

View File

@@ -7,13 +7,13 @@ if [ -n "${NFS_TARGET}" ]; then
mount -o nolock -v ${NFS_TARGET} /mnt/restic
fi
restic snapshots &>/dev/null
restic snapshots ${RESTIC_INIT_ARGS} &>/dev/null
status=$?
echo "Check Repo status $status"
if [ $status != 0 ]; then
echo "Restic repository '${RESTIC_REPOSITORY}' does not exists. Running restic init."
restic init
restic init ${RESTIC_INIT_ARGS}
init_status=$?
echo "Repo init status $init_status"
@@ -37,4 +37,4 @@ crond
echo "Container started."
exec "$@"
exec "$@"