mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-03-21 14:22:43 +00:00
add init args env variable
This commit is contained in:
@@ -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=""
|
||||
|
||||
6
entry.sh
6
entry.sh
@@ -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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user