better backup script

This commit is contained in:
Ludwig Lehnert
2026-07-17 13:23:00 +00:00
parent fb7a69d24c
commit 39968c5be8
6 changed files with 608 additions and 24 deletions

View File

@@ -214,6 +214,15 @@ write_runtime_env_file() {
if [[ -n "${BACKUP_RETENTION_YEARLY:-}" ]]; then
printf 'export BACKUP_RETENTION_YEARLY=%q\n' "$BACKUP_RETENTION_YEARLY"
fi
if [[ -n "${BACKUP_LOG_FILE:-}" ]]; then
printf 'export BACKUP_LOG_FILE=%q\n' "$BACKUP_LOG_FILE"
fi
if [[ -n "${BACKUP_PROGRESS:-}" ]]; then
printf 'export BACKUP_PROGRESS=%q\n' "$BACKUP_PROGRESS"
fi
if [[ -n "${BACKUP_PROGRESS_INTERVAL_SECONDS:-}" ]]; then
printf 'export BACKUP_PROGRESS_INTERVAL_SECONDS=%q\n' "$BACKUP_PROGRESS_INTERVAL_SECONDS"
fi
if [[ -n "${JOIN_USER:-}" ]]; then
printf 'export JOIN_USER=%q\n' "$JOIN_USER"
fi
@@ -288,7 +297,7 @@ EOF
if [[ -n "${BACKUP_DESTINATION:-}" ]]; then
cat >> /etc/cron.d/reconcile-shares <<EOF
0 ${BACKUP_START_HOUR} * * * root source /app/runtime.env && /usr/bin/python3 /app/backup_to_destination.py >> /var/log/backup.log 2>&1
0 ${BACKUP_START_HOUR} * * * root source /app/runtime.env && /usr/bin/python3 /app/backup_to_destination.py
EOF
fi