Genericize backup documentation and defaults
This commit is contained in:
1 parent
3d52a9af33
commit
ac6823f840
5 files changed
+25
-21
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# Zorruno Docker Backup Scripts
|
||||
# Docker Backup Scripts
|
||||
|
||||
Modular backup scripts for Docker Compose servers.
|
||||
Each server has its own untracked `.env` and `containers.local.txt`, while all script
|
||||
@@ -21,9 +21,9 @@ pruning on any failure, and exits non-zero so schedulers still detect the
|
||||
problem. A partial archive run with successful transfers is reported as
|
||||
`partial`, not as full success.
|
||||
|
||||
Every stage can also be run directly. The old `docker-backup.sh` name invokes
|
||||
the container archive stage, while `dockerbackup_prune.sh` invokes the local
|
||||
prune stage. Use the new `backup.sh` for the complete pipeline.
|
||||
Stages can also be run directly. Use `stages/10-containers.sh` to create
|
||||
archives and `stages/90-prune.sh` to prune local archives. Use `backup.sh` to
|
||||
run the complete pipeline, including configured transfers and pruning.
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -35,12 +35,14 @@ prune stage. Use the new `backup.sh` for the complete pipeline.
|
||||
- `rsync` and `mountpoint` only when the SMB method is enabled
|
||||
|
||||
The account running the scripts must be allowed to control Docker and read all
|
||||
files under `/dockervolumes`.
|
||||
files under `SOURCE_BASE_DIR`, and write to the directory containing
|
||||
`BACKUP_HISTORY_FILE`.
|
||||
|
||||
## Installation on a server
|
||||
|
||||
```bash
|
||||
sudo git clone https://home.fox.co.nz/gitea/zorruno/zorruno-backupdockerscript.git /backupdockerscripts
|
||||
REPOSITORY_URL="REPLACE_WITH_REPOSITORY_URL"
|
||||
sudo git clone "$REPOSITORY_URL" /backupdockerscripts
|
||||
cd /backupdockerscripts
|
||||
sudo cp .env.example .env
|
||||
sudo cp containers.txt containers.local.txt
|
||||
@@ -80,8 +82,8 @@ Copy `.env.example` to `.env`; `.env` is ignored by Git. Important values:
|
||||
| `BACKUP_HOSTNAME` | Host folder/name embedded in archive filenames |
|
||||
| `BACKUP_METHODS` | Ordered method names, default `rclone smb` |
|
||||
| `ZSTD_EXTRA_OPTS` | Options passed to `zstd`, default `-T0 -12` |
|
||||
| `TAR_EXCLUDES` | Space-separated archive paths to omit, relative to `SOURCE_BASE_DIR` |
|
||||
| `BACKUP_HISTORY_FILE` | JSON Lines run-history file (default is shared with backup-status MCP) |
|
||||
| `TAR_EXCLUDES` | Space-separated archive-member paths to omit, e.g. `project/data` |
|
||||
| `BACKUP_HISTORY_FILE` | JSON Lines run-history file, default `/var/lib/docker-backup/history.jsonl` |
|
||||
| `BACKUP_HISTORY_DAYS` | Days of completed run history to retain, default `30` |
|
||||
| `BACKUP_REQUIRE_ENCRYPTED_STORAGE` | Refuse to run unless `/dockerbackups` is on `/srv/storage`; default `0` |
|
||||
| `KEEP_COUNT` | Local archives retained per Compose project |
|
||||
@@ -158,7 +160,7 @@ MQTT_REPORT_ENABLED=1
|
||||
MQTT_HOST="examplehostname"
|
||||
MQTT_PORT=1883
|
||||
MQTT_USERNAME="dockerbackup"
|
||||
MQTT_PASSWORD_FILE="/etc/zorruno-docker-backup/mqtt-password"
|
||||
MQTT_PASSWORD_FILE="/etc/docker-backup/mqtt-password"
|
||||
MQTT_STATUS_TOPIC="backup-status/dockerbackup/examplehostname"
|
||||
MQTT_COMMAND_TOPIC="backup-commands/dockerbackup/examplehostname/run"
|
||||
```
|
||||
@@ -171,9 +173,9 @@ reported when MQTT remains available.
|
||||
Install the optional root-run command listener with:
|
||||
|
||||
```bash
|
||||
cp systemd/zorruno-docker-backup-mqtt.service /etc/systemd/system/
|
||||
cp systemd/docker-backup-mqtt.service /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now zorruno-docker-backup-mqtt.service
|
||||
systemctl enable --now docker-backup-mqtt.service
|
||||
```
|
||||
|
||||
It accepts only JSON containing the exact action `run` on the configured
|
||||
@@ -202,8 +204,9 @@ BACKUP_METHODS="rclone smb restic"
|
||||
```
|
||||
|
||||
The main pipeline discovers the numbered file from the short name and runs it
|
||||
after the earlier methods. A failed method stops the pipeline, so pruning will
|
||||
not run after a failed transfer.
|
||||
after the earlier methods. If a transfer method fails, remaining configured
|
||||
methods are still attempted, pruning is skipped, and the overall run exits
|
||||
non-zero.
|
||||
|
||||
## Archive and restore format
|
||||
|
||||
|
||||
Reference in new issue
Block a user