This page documents the actual backup setup used in Enclari. It reflects your current /root/backup.sh script, which automates per‑service backups to Restic with rclone pCloud backend.
rclone:pcloud:backups/restic/root/.restic-env with RESTIC_REPOSITORY and RESTIC_PASSWORD/root/backup.sh/opt/stack/<service><service>_*service=<service>, auto, and the timestampionice and nice enabled; rclone bandwidth limit via RCLONE_BW_LIMIT (default 10M)/var/lock/backup.lock prevents concurrent runs/root/backup-tmp/<timestamp>/opt/restore/<service>-<timestamp> by defaultInstall and configure:
restic, rclone, jq, util-linux (for flock), rsyncpcloud pointing to your pCloud account/root/.restic-env:export RESTIC_REPOSITORY="rclone:pcloud:backups/restic"
export RESTIC_PASSWORD="********"
Load before manual commands:
source /root/.restic-env
The script supports backup, list and restore. It auto‑selects paths from /opt/stack/<service> and Docker volumes named <service>_*.
/root/backup.sh backup all
/root/backup.sh backup <svc1> [svc2 ...]
/root/backup.sh list
/root/backup.sh list <svc>
/root/backup.sh restore <svc> [--snap ID|latest] [--to DIR]
/root/backup.sh services # list services from /opt/stack
/root/backup.sh services <svc> # list volumes for a service
# Back up everything discovered under /opt/stack
/root/backup.sh backup all
# Back up only selected services
/root/backup.sh backup wp nextcloud docs
# Show all snapshots or only for one service
/root/backup.sh list
/root/backup.sh list docs
# Restore latest snapshot for a service into default target dir
/root/backup.sh restore docs
# Restore to a custom directory and a specific snapshot id
/root/backup.sh restore docs --snap 1a2b3c4d --to /opt/restore/docs-test
/opt/stack/<service> directory<service>_*/_dataCommon excludes (applied by the script):
**/cache/**, **/*.log, **/tmp/**Applied automatically after the run:
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 1 --prune
When you run restore, the script will pick latest snapshot for the service (unless --snap is provided), restore into the target folder, and print the exact rsync commands you can use to rehydrate.
Typical flow for a service docs:
# 1) Stop the service
cd /opt/stack/docs && docker compose down
# 2) Rehydrate volumes
for V in $(docker volume ls -q | grep '^docs_'); do
rsync -aHAX --delete "/opt/restore/docs-<TS>/var/lib/docker/volumes/$V/_data/" "/var/lib/docker/volumes/$V/_data/"
done
# 3) Restore compose/config
rsync -aHAX --delete "/opt/restore/docs-<TS>/opt/stack/docs/" "/opt/stack/docs/"
# 4) Start the service
cd /opt/stack/docs && docker compose up -d
Tip: The script prints these steps after each restore with the correct
<service>name.
# Dry check: show discovered services
/root/backup.sh services
# One-shot full backup
source /root/.restic-env
/root/backup.sh backup all
# Verify snapshots
restic snapshots --tag service=docs
# Housekeeping (already done by the script, but you can run manually)
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 1 --prune
/opt/stack/* and Docker volumes on the same filesystem so rsync rehydration paths are correct.