Resume pending publications under local pressure, allow verified offsite-only history as a final local recovery stage, and prune old complete remote sets against actual upload quota while preserving the newest verified copies. Document defaults, recovery limits and validation; add pressure and quota regression coverage.
144 lines
5.4 KiB
Plaintext
144 lines
5.4 KiB
Plaintext
# app-backup v2. Trusted Bash configuration, root:root, mode 600.
|
|
# Existing installations retain their file; merge new options from .conf.dist.
|
|
WORKDIR="/var/backups/app-backup"
|
|
STAGING_ROOT="$WORKDIR/staging"
|
|
ARCHIVE_DIR="$WORKDIR/archives"
|
|
RESTORE_ROOT="$WORKDIR/restore"
|
|
LOG_DIR="/var/log/app-backup"
|
|
LOCKFILE="/run/app-backup.lock"
|
|
ARCHIVE_PREFIX="appbackup"
|
|
|
|
# Local staging and archives contain plaintext: use an encrypted server volume.
|
|
MIN_FREE_GB=10
|
|
COMPRESSOR="zstd"
|
|
ZSTD_LEVEL=6
|
|
ZSTD_THREADS=2
|
|
LOG_RETENTION_DAYS=30
|
|
LOCAL_RETENTION_DAYS=7
|
|
REMOTE_RETENTION_DAYS=30
|
|
RETENTION_KEEP_LAST=3
|
|
# First pressure stage: retain this many uploaded local sets (minimum one).
|
|
# SPACE_ALLOW_REMOTE_ONLY can release this floor as a last resort.
|
|
# Set SPACE_ALLOW_REMOTE_ONLY=false to enforce it unconditionally.
|
|
SPACE_KEEP_LOCAL=1
|
|
# If the floor prevents a new backup: permit offsite-only history after full
|
|
# local validation + remote sizes/identity checks. false enforces the floor.
|
|
SPACE_ALLOW_REMOTE_ONLY=true
|
|
# Quota-driven offsite cleanup is separate from normal age-based retention.
|
|
# Keeps at least the newest verified complete remote set, including before upload.
|
|
SPACE_REMOTE_CLEANUP=true
|
|
SPACE_KEEP_REMOTE=1
|
|
# Enable deliberately after a successful restore rehearsal. v1 runs are retained.
|
|
ENABLE_REMOTE_RETENTION="false"
|
|
|
|
ENABLE_UPLOAD="true"
|
|
RCLONE_BIN="rclone"
|
|
RCLONE_CONFIG="/root/.config/rclone/rclone.conf"
|
|
RCLONE_REMOTE_BASE="OneDriveCrypt:gemini"
|
|
RCLONE_RETRIES=6
|
|
RCLONE_LOW_LEVEL_RETRIES=20
|
|
RCLONE_RETRIES_SLEEP="30s"
|
|
RCLONE_TIMEOUT="1h"
|
|
RCLONE_CONTIMEOUT="30s"
|
|
# Periodic transfer/check statistics in journald, including otherwise quiet uploads.
|
|
RCLONE_STATS_INTERVAL="1m"
|
|
# Retry policy: metadata checks and individual monthly restore-test downloads.
|
|
# Independent of upload retries. All times are seconds.
|
|
# Deadline includes backend waits and applies per attempt.
|
|
RCLONE_CHECK_ATTEMPTS=3
|
|
RCLONE_CHECK_RETRY_DELAY=30
|
|
RCLONE_CHECK_TIMEOUT=300
|
|
RCLONE_CHECK_DEADLINE=3600
|
|
RCLONE_CHECK_LOW_LEVEL_RETRIES=3
|
|
RCLONE_TRANSFERS=2
|
|
RCLONE_CHECKERS=4
|
|
# OneDrive chunks must be multiples of 320 KiB; 80 MiB satisfies this.
|
|
RCLONE_ONEDRIVE_CHUNK_SIZE="80Mi"
|
|
RCLONE_BWLIMIT="0"
|
|
ENABLE_MAIL_REPORT="true"
|
|
MAIL_TO="johannes"
|
|
# Empty means app-backup@<FQDN>. Existing sender/subject/tail settings are preserved.
|
|
MAIL_FROM=""
|
|
MAIL_SUBJECT_PREFIX="[app-backup]"
|
|
# Host in subject/report only; empty uses the system FQDN. Sender is unchanged.
|
|
# Example for Gemini: MAIL_HOSTNAME="gemini.jr-it-services.de"
|
|
MAIL_HOSTNAME=""
|
|
MAIL_INCLUDE_LOG_TAIL_LINES=200
|
|
MAIL_SENDMAIL_BIN="/usr/sbin/sendmail"
|
|
MAIL_SEND_TIMEOUT=30
|
|
|
|
# Monthly offsite restore rehearsal. The updater --enable-restore-test prepares
|
|
# a matching LOCAL MariaDB image; monthly jobs never download images.
|
|
ENABLE_RESTORE_TEST="false"
|
|
RESTORE_TEST_DB_IMAGE=""
|
|
# Components are processed sequentially; fail/clean up if a component will not fit.
|
|
# 0: adaptive to free space; a positive value adds a fixed scratch limit.
|
|
RESTORE_TEST_MAX_WORK_GB=0
|
|
RESTORE_TEST_MIN_FREE_GB=2
|
|
RESTORE_TEST_MAX_AGE_HOURS=72
|
|
RESTORE_TEST_TIMEOUT=39600
|
|
|
|
ENABLE_WORDPRESS="true"
|
|
WP_DIR="/var/www/html"
|
|
# Nextcloud paths below WP_DIR are automatically excluded (including on restore).
|
|
WP_EXCLUDES=()
|
|
|
|
ENABLE_NEXTCLOUD="true"
|
|
ENABLE_NEXTCLOUD_DATA="true"
|
|
ENABLE_NEXTCLOUD_MAINTENANCE="true"
|
|
NC_DIR="/var/www/html/nextcloud"
|
|
NC_DATA_DIR="$NC_DIR/data"
|
|
NC_OCC_USER="apache"
|
|
|
|
# Native MariaDB-backed Gitea. Enable only after checking app.ini paths.
|
|
ENABLE_GITEA="false"
|
|
ENABLE_GITEA_SERVICE_STOP="true"
|
|
GITEA_SERVICE_NAME="gitea"
|
|
GITEA_DATA_DIR="/var/lib/gitea/data"
|
|
GITEA_ETC_DIR="/etc/gitea"
|
|
# Repository ROOT and custom directory can be OUTSIDE APP_DATA_PATH.
|
|
# GITEA_REPOS_DIR="/var/lib/gitea/repositories"
|
|
# GITEA_CUSTOM_DIR="/var/lib/gitea/custom"
|
|
|
|
# Stop all writers throughout dumps + staging; downtime depends on data size.
|
|
ENABLE_HTTPD_STOP="true"
|
|
HTTPD_SERVICE_NAME="httpd"
|
|
ENABLE_PHPFPM_STOP="true"
|
|
PHPFPM_SERVICE_NAME="php-fpm"
|
|
# Add actual Nextcloud cron timers/services, queue workers, containers, etc.
|
|
# A timer and its currently running service must BOTH be included, timer first.
|
|
QUIESCE_SERVICES=()
|
|
|
|
ENABLE_DB_DUMPS="true"
|
|
# Auto-detect mariadb-dump/mariadb; fallback to mysqldump/mysql.
|
|
# DB_DUMP_BIN="mariadb-dump"
|
|
# DB_CLIENT_BIN="mariadb"
|
|
WP_DB_NAME="wordpress"
|
|
NC_DB_NAME="nextcloud"
|
|
GITEA_DB_NAME="gitea"
|
|
WP_DB_CNF="/etc/app-backup/wp-db.cnf"
|
|
NC_DB_CNF="/etc/app-backup/nc-db.cnf"
|
|
GITEA_DB_CNF="/etc/app-backup/db-gitea.cnf"
|
|
# Restore needs accounts with DDL/DML rights. Use a separate --config FILE for it.
|
|
|
|
ENABLE_MAIL="true"
|
|
MAIL_BACKUP_MODE="stop"
|
|
# Nur false setzen, wenn alle Mailboxen durch MAIL_HOME_DIRS abgedeckt sind.
|
|
# Postfix/Dovecot und deren Dienststopps bleiben auch dann aktiviert.
|
|
ENABLE_MAIL_STORE="true"
|
|
MAIL_DIR="/var/vmail"
|
|
POSTFIX_DIR="/etc/postfix"
|
|
DOVECOT_DIR="/etc/dovecot"
|
|
ENABLE_MAIL_HOME_DIRS="true"
|
|
MAIL_HOME_DIRS=("/home/johannes" "/home/luciana")
|
|
# Home copies stay on one filesystem; excluded directories are not backed up.
|
|
MAIL_HOME_EXCLUDES=("OneDrive/" ".cache/" ".ccache/" ".local/share/Trash/")
|
|
|
|
# Additional directories; only files, no automatic DB/container snapshot semantics.
|
|
# Keep ordering stable: entries become extra-0, extra-1, ...
|
|
# Gemini updater --enable-ai-rem appends /srv/ai-rem and /etc/ai-rem here,
|
|
# and adds ai-rem plus its maintenance timers/services to QUIESCE_SERVICES.
|
|
EXTRA_PATHS=()
|
|
# Restore target directories must already exist. Deletion is off by default.
|
|
RESTORE_STRICT_DELETE="false"
|