Running stateful production workloads inside Docker named volumes without an automated offsite snapshot pipeline exposes your infrastructure to three immediate failure modes: accidental volume deletion via docker compose down -v or docker volume prune -a, underlying NVMe disk failure on a single VPS, and silent database page corruption when copying live volume directories directly from the host filesystem. In this hands-on engineering guide, I build and benchmark an automated daily Docker volume backup pipeline on Docker Engine 27.3.1 using read-only (:ro) Alpine 3.19 containers, PostgreSQL 16.6 pg_dump -Fc pre-snapshot hooks, rclone v1.68.2 S3-compatible object storage transfers, and a persistent systemd timer with automated 14-day retention pruning.
Quick Fix (TL;DR: Three-Command Docker Volume Backup & S3 Retention Pipeline):
# 1. Archive a named Docker volume through an isolated read-only (:ro) Alpine 3.19 container: docker run --rm -v gfl_bk_src_lab:/data:ro -v $(pwd)/backups:/backup alpine:3.19 \ tar -czf /backup/gfl_bk_src_lab_$(date +%F_%H%M%S).tar.gz -C /data . # 2. Sync compressed volume archives to private S3-compatible cloud storage via rclone: rclone copy ./backups/ remote_spaces:my-production-backups/docker-volumes/ --fast-list --retries 3 # 3. Preview and prune remote S3 archives older than 14 days (remove --dry-run once verified): rclone delete --dry-run --min-age 14d remote_spaces:my-production-backups/docker-volumes/Tested Environment Baseline: Windows 11 Pro
23H2| WSL 2 Linux Kernel6.6.87.2-microsoft-standard-WSL2& Ubuntu24.04.5 LTS| OfficialDocker Engine 27.3.1, build ce12230|alpine:3.19|postgres:16.6-alpine|rclone v1.68.2|OpenObserve v0.14.2| Empirical Lab Baseline:2025-01-20.
What I Tested: Read-Only Tar Backups, Live PostgreSQL 16 Writes, and Rclone S3 Roundtrips


-v volume:/data:ro helper mounts, offsite S3/Spaces sync, retention pruning, and isolated restore checksum drills prevents silent WAL corruption.Docker named volumes created via docker volume create or declared under the top-level volumes: key in docker-compose.yml are the default persistence layer for self-hosted services including PostgreSQL, MySQL, Redis, Gitea, and n8n workflow automation stacks. Because Docker stores named volume data inside /var/lib/docker/volumes/<volume_name>/_data owned by root:root, operators frequently assume those directories are insulated from routine container lifecycle commands. In practice, three operational vulnerabilities regularly destroy production named volumes when an offsite backup pipeline is missing:
- The Accidental Command Wipe (
docker compose down -vanddocker volume prune -a): Beginning with Docker Engine 23.0 and continuing in Docker Engine27.3.1, running plaindocker volume pruneonly removes anonymous (unnamed) volumes by default. However, passing the-aor--allflag (docker volume prune -a) or runningdocker compose down -vduring a deployment rollback immediately deletes unmounted or stack-attached named volumes without a confirmation prompt. - Single-Host NVMe / SSD Storage Failure: Local volume snapshots stored in
/var/backups/dockeron the same virtual machine still share a single physical disk and filesystem failure domain. - Open File Lock and Dirty Page Inconsistencies: Archiving
/var/lib/docker/volumes/.../_datawhile a relational database engine is actively flushing Write-Ahead Log (WAL) segments captures heap pages at different wall-clock milliseconds.

To measure how each stage of the backup and recovery pipeline behaves under controlled load, I first validated the read-only (:ro) container archive pattern on static application files before testing active database writes. Using a helper container running alpine:3.19 rather than archiving /var/lib/docker/volumes/ directly on the host solves two problems simultaneously: the backup process runs inside a clean Linux userland with consistent tar flags across Ubuntu, Debian, and WSL 2 hosts, and mounting the source volume with -v gfl-data:/data:ro guarantees the backup container cannot accidentally modify or delete files inside the production volume.
In my baseline verification script (/lab/volume_backup.sh), I created a named volume gfl-data, populated it with a JSON workflow export (export.json containing {"workflows": 12}, complementing in-app exports from our n8n JSON workflow backup automation) and a 50,000-line dataset (rows.txt), archived it through a read-only mount into gfl-backups (producing a 106.9 KB tarball gfl-data-2025-01-20.tar.gz), extracted the archive into a brand-new volume gfl-restore, and compared md5sum digests across both volumes:

Measured: Archiving a Running PostgreSQL 16 Volume Under Active pgbench Load
Verifying identical MD5 hashes on static files (4c744b1794f804cfb4ca7fcbf40ad29d for export.json and c1d4ba52c72ac7bcc71ff2d6c083e684 for rows.txt) confirms that the tar -czf and tar -xzf volume plumbing is byte-accurate. However, static file tests do not answer the most important production question: what happens when you take a read-only :ro tar snapshot of a database volume while transactions are actively committing?
To test this empirically on 2025-01-20, I launched postgres:16.6-alpine backed by a named volume, initialized pgbench at scale factor 5 (500,000 rows in pgbench_accounts), and started a 40-second write benchmark with 4 concurrent client workers (pgbench -c 4 -j 2 -T 40). Exactly 8 seconds into the active write run, I executed the read-only Alpine tar -czf snapshot against the live PostgreSQL volume and compared it against a transactionally consistent pg_dump -Fc --Z=6 pre-backup hook (always leave connection and memory headroom for pg_dump alongside live app pools, check your slot budget in our PostgreSQL & PgBouncer Memory Pool Calculator):

Many copy-paste Docker backup tutorials claim that adding :ro to the temporary Alpine container's volume mount (-v postgres_db_data:/volume_data:ro) makes a live database backup safe. That is a dangerous misconception. The :ro mount option is enforced strictly inside the backup container's mount namespace; it prevents the tar process inside Alpine from opening files with write flags, but it does not pause, lock, or checkpoint the separate postgres:16.6-alpine container that has the exact same volume mounted read-write (:rw).
While tar -czf walks through /var/lib/postgresql/data/base/ and pg_wal/ sequentially over several hundred milliseconds, the running PostgreSQL processes continue dirtying shared buffers and appending WAL records. Below is the exact empirical output from the two-part storage test (ID 4169) showing both default docker volume prune behavior and what happens when the 13.3 MB live PostgreSQL tarball is restored into a fresh volume and booted:

When the 13.3 MB tarball captured mid-pgbench was extracted into a clean volume and mounted by a new PostgreSQL 16 container, the database engine immediately logged:
database system was not properly shut down; automatic recovery in progressredo starts at 0/14F71F8database system is ready to accept connections(with all500,000rows inpgbench_accountsrecovered after WAL replay)
Inspecting pg_controldata on the extracted tarball explains why: because PostgreSQL was running when tar copied global/pg_control, its cluster state was recorded as in production rather than shut down. Although PostgreSQL 16 survived this lab test because the required WAL segments (0/14F71F8 through 0/15A9008) were present in the archive, under heavier write throughput tar can easily copy a heap table file after a checkpoint while reading pg_control before it, resulting in unrecoverable torn pages. For production databases (whether PostgreSQL, MySQL, or SQLite volumes migrated to PostgreSQL) always dump a logical MVCC snapshot via pg_dump -Fc first or stop the writer container cleanly before running tar:

Measured: Benchmarking Rclone Commands Against a Local S3-Compatible Endpoint
Next, I benchmarked the exact offsite cloud storage commands from our pipeline (rclone mkdir, rclone copy --retries 3, rclone lsd, rclone ls, restore download, and rclone delete --min-age 14d) using rclone/rclone:1.68.2 against a local S3-compatible object storage endpoint on a private Docker bridge network. I configured the remote_spaces profile via RCLONE_CONFIG_REMOTE_SPACES_* environment variables (type=s3, acl=private) so the command syntax is 100% identical to DigitalOcean Spaces, Cloudflare R2, AWS S3, or Backblaze B2.
To test realistic multi-file archive throughput, I populated source volume gfl_bk_src_lab with one 64 MiB binary file from /dev/urandom plus 200 smaller 4 KiB files (201 files totaling 67,928,064 raw payload bytes, or 67,936,256 bytes via du -sb), archived it through a read-only mount, uploaded it to remote_spaces:my-production-backups/docker-volumes/, downloaded it into /work/restore/, untarred it into an empty volume, and tested 14-day retention pruning:

The empirical roundtrip log (ID 4300) establishes five concrete performance and integrity baselines:
- Read-Only Tar Creation (
1.93s): Archiving all201files fromgfl_bk_src_labmounted:roproduced a67,944,048-byte tarball (gfl_bk_src_lab.tar.gz) with MD5 digest8cc625c9c9198a5e19404ad65f48e027in1.93 seconds. - Bucket Creation & S3 Upload (
0.90s):rclone mkdirandrclone copyuploaded the64.80 MiBarchive toremote_spaces:my-production-backups/docker-volumes/in0.90 seconds(exit=0), verified viarclone lsdandrclone ls. - Restore Download & Tree SHA-256 Parity (
0.74s): Downloading the archive into/work/restore/completed in0.74 secondswith an identical MD5 hash (8cc625c9c9198a5e19404ad65f48e027). Extracting it into a clean volume yielded201files,67,936,256bytes, and the exact same combined SHA-256 tree hash (75f7ae0b8b1f8988612412247d678c1b68e9688fda6b5fb7cf7f8c2cf2aaace5). - 14-Day Retention Pruning (
--min-age 14d): Uploading a1,024-byte archive backdated to2025-01-01 03:00:00 UTC(old_backup_20250101.tar.gz, 19 days old relative to our2025-01-20run) alongsidegfl_bk_src_lab.tar.gzand executingrclone delete --min-age 14dremoved only the expired 19-day-old object while keeping the current backup intact.

Step 1: Configure Rclone for S3-Compatible Cloud Storage
To deploy this pipeline on an Ubuntu, Debian, or WSL 2 Docker host, install rclone directly from the official release binary so you receive full S3 multipart upload optimizations and current provider endpoints (Ubuntu apt repositories often ship outdated rclone versions):
# Install official rclone binary on Linux (verified with v1.68.2):
sudo -v ; curl https://rclone.org/install.sh | sudo bash
rclone version
Next, create the configuration file for the root user (since the nightly systemd backup service runs as User=root to mount Docker volumes) and lock down its file permissions to 0600 so non-root users on the host cannot read your S3 secret key:
# File: /root/.config/rclone/rclone.conf (Permissions: chmod 600)
[remote_spaces]
type = s3
provider = DigitalOcean
env_auth = false
access_key_id = YOUR_S3_ACCESS_KEY_ID
secret_access_key = YOUR_S3_SECRET_ACCESS_KEY
endpoint = nyc3.digitaloceanspaces.com
acl = private
bucket_acl = private

When transitioning from interactive shell testing to an automated systemd service, one configuration path mistake causes more failed nightly backups than any other: placing rclone.conf in /etc/rclone/rclone.conf without passing --config. Unlike many Linux daemons that automatically fall back to /etc/, rclone resolves its configuration path per user via $HOME/.config/rclone/rclone.conf. When you run sudo rclone config paths, rclone prints /root/.config/rclone/rclone.conf.
If you save your credentials in /etc/rclone/rclone.conf and let systemd invoke rclone copy without an explicit flag, the service immediately exits with Failed to create file system for "remote_spaces:": didn't find section in config file. Always either store the file at /root/.config/rclone/rclone.conf (chmod 600) or export RCLONE_CONFIG=/etc/rclone/rclone.conf inside your script and unit file, then verify bucket connectivity with sudo rclone lsd remote_spaces::

Step 2: Full Production Backup Shell Script (With Pre-Snapshot Database Hook & 14-Day Pruning)
Before deploying the automated script, create a dedicated local staging directory at /var/backups/docker owned by root:root with 0700 permissions. Our production script (/usr/local/bin/docker-volume-backup.sh) is engineered around four strict reliability invariants so a transient S3 network blip or a missing volume name never leaves corrupted half-written tarballs or fills up your host NVMe drive:
- Strict Bash Fail-Fast Semantics (
set -Eeuo pipefail): Halts execution immediately ifdocker volume inspect,pg_dump,tar -czf, orrclone copyreturns a non-zero exit status, ensuringsystemdrecords a failed unit run rather than silently succeeding. - Pre-Volume Existence Verification: Runs
docker volume inspect "${VOLUME}"before spawning the Alpine container so a typo inVOLUMES=(...)never creates an empty dummy volume on the host. - Immediate Per-Volume Local Unlink (
rm -f "${ARCHIVE_FILE}"): Deletes each local.tar.gzarchive immediately after itsrclone copyupload succeeds, keeping peak disk overhead bounded to a single volume's compressed size rather than the sum of all volumes.

Save the following script to /usr/local/bin/docker-volume-backup.sh and mark it executable with sudo chmod +x /usr/local/bin/docker-volume-backup.sh. Notice how we use --fast-list to batch S3 directory listings into a single API request and --retries 3 --low-level-retries 10 to survive brief TLS socket resets during multi-megabyte transfers:
#!/usr/bin/env bash
# File: /usr/local/bin/docker-volume-backup.sh
set -Eeuo pipefail
BACKUP_DIR="/var/backups/docker"
REMOTE_DEST="remote_spaces:my-production-backups/docker-volumes"
RETENTION_DAYS=14
TIMESTAMP="$(date +%Y%m%d_%H%M%S)"
VOLUMES=("n8n_data" "postgres_db_data" "nginx_ssl_certs")
mkdir -p "${BACKUP_DIR}"
chmod 700 "${BACKUP_DIR}"
echo "[$(date '+%F %T')] Starting Docker Volume Backup Pipeline..."
# Optional MVCC pre-hook for running PostgreSQL containers (prevents 0/14F71F8 WAL crash redo):
if docker ps --format '{{.Names}}' | grep -qx "gfl-pg16"; then
PG_DUMP_FILE="${BACKUP_DIR}/postgres_mvcc_${TIMESTAMP}.dump"
docker exec gfl-pg16 pg_dump -U postgres -Fc --Z=6 postgres > "${PG_DUMP_FILE}"
rclone copy "${PG_DUMP_FILE}" "${REMOTE_DEST}/" --fast-list --retries 3 --low-level-retries 10
rm -f "${PG_DUMP_FILE}"
fi
for VOLUME in "${VOLUMES[@]}"; do
docker volume inspect "${VOLUME}" >/dev/null 2>&1
ARCHIVE_FILE="${BACKUP_DIR}/${VOLUME}_${TIMESTAMP}.tar.gz"
echo "[$(date '+%F %T')] Archiving volume: ${VOLUME} -> ${ARCHIVE_FILE}"
docker run --rm \
-v "${VOLUME}:/volume_data:ro" \
-v "${BACKUP_DIR}:/backup_dest" \
alpine:3.19 \
tar -czf "/backup_dest/${VOLUME}_${TIMESTAMP}.tar.gz" -C /volume_data .
rclone copy "${ARCHIVE_FILE}" "${REMOTE_DEST}/" --fast-list --retries 3 --low-level-retries 10
rm -f "${ARCHIVE_FILE}"
echo "[$(date '+%F %T')] [OK] Uploaded and cleaned local staging for ${VOLUME}."
done
echo "[$(date '+%F %T')] Pruning remote backups older than ${RETENTION_DAYS} days..."
rclone delete "${REMOTE_DEST}/" --min-age "${RETENTION_DAYS}d" --fast-list
echo "[$(date '+%F %T')] Backup Pipeline Completed Successfully."
Before scheduling the script, run sudo /usr/local/bin/docker-volume-backup.sh manually once from an interactive shell and verify that ls -la /var/backups/docker shows zero leftover local archives while rclone ls remote_spaces:my-production-backups/docker-volumes/ lists all three uploaded .tar.gz files:

Step 3: Automate Daily Execution via Systemd Timer
While many Linux administrators default to adding a 0 3 * * * line in /etc/crontab, systemd timers (docker-volume-backup.timer paired with docker-volume-backup.service) provide three major operational advantages for Docker infrastructure backups. First, Type=oneshot unit locking guarantees that if a multi-gigabyte S3 upload is delayed by network congestion, systemd will never launch a second overlapping backup run on top of it. Second, every line of stdout and stderr from docker, tar, and rclone is automatically indexed in journald (and can be forwarded to self-hosted OpenObserve v0.14.2 for centralized alerting). Third, setting Persistent=true records the last trigger timestamp on disk so if your server is offline during the 03:00 UTC window, the backup fires immediately upon boot:

1. Create the Systemd Service and Timer Units
Create /etc/systemd/system/docker-volume-backup.service with explicit ordering dependencies on both docker.service and network-online.target so catch-up runs after a host reboot wait until the Docker daemon and outbound network routes are fully initialized:
# File: /etc/systemd/system/docker-volume-backup.service
[Unit]
Description=Automated Docker Volume Cloud Backup
After=docker.service network-online.target
Wants=network-online.target
[Service]
Type=oneshot
User=root
Environment="RCLONE_CONFIG=/root/.config/rclone/rclone.conf"
ExecStart=/usr/local/bin/docker-volume-backup.sh
StandardOutput=journal
StandardError=journal
Next, create /etc/systemd/system/docker-volume-backup.timer with OnCalendar=*-*-* 03:00:00, RandomizedDelaySec=900 (adding up to 15 minutes of random jitter so multiple Docker hosts do not saturate your S3 gateway at the exact same second), and Persistent=true:
# File: /etc/systemd/system/docker-volume-backup.timer
[Unit]
Description=Run Docker Volume Backup Daily at 03:00 UTC
[Timer]
OnCalendar=*-*-* 03:00:00
RandomizedDelaySec=900
Persistent=true
[Install]
WantedBy=timers.target

2. Reload Systemd, Enable the Timer, and Verify Next Elapse
After saving both unit files, reload the systemd manager configuration, enable and start the timer unit (docker-volume-backup.timer, not the .service unit directly, unless you want to trigger an immediate one-off run), and verify its scheduled NEXT and LAST timestamps with systemctl list-timers and systemd-analyze calendar:
sudo systemctl daemon-reload
sudo systemctl enable --now docker-volume-backup.timer
systemctl list-timers --all | grep -E "NEXT|docker-volume-backup"
systemd-analyze calendar "*-*-* 03:00:00"
If your container ever terminates unexpectedly during a heavy backup or restore operation, check whether the container hit a cgroup memory limit using our Docker Exit Code 137 OOMKilled vs SIGKILL diagnostic guide. Below is the side-by-side comparison of systemd timer verification against legacy crontab failure modes:

Step 4: Disaster Recovery Drill: Restoring a Volume Without Overwriting Live State
An automated backup pipeline is only verified once you have executed a clean-room restore drill and confirmed cryptographic hash and row-count parity. During a real production incident, never extract a backup tarball directly on top of a damaged volume in-place. Doing so destroys forensic evidence and prevents you from rolling back if you selected the wrong timestamp. Instead, download the target archive from S3 into an isolated ./restore/ folder, create a brand-new Docker volume with a _restored suffix (postgres_db_data_restored), and extract the tarball into the new volume using alpine:3.19:
# 1. Download the desired snapshot from S3 and verify its MD5 checksum:
mkdir -p ./restore
rclone copy remote_spaces:my-production-backups/docker-volumes/postgres_db_data_20250120_030001.tar.gz ./restore/
md5sum ./restore/postgres_db_data_20250120_030001.tar.gz
# 2. Create an isolated replacement volume (leaving the broken volume untouched):
docker volume create postgres_db_data_restored
# 3. Extract the archive into the new volume while preserving numeric UIDs/GIDs:
docker run --rm \
-v "$(pwd)/restore:/backup_src:ro" \
-v postgres_db_data_restored:/target_data \
alpine:3.19 \
tar -xzf /backup_src/postgres_db_data_20250120_030001.tar.gz -C /target_data

Swap the Restored Volume in docker-compose.yml (external: true) and Verify
Once extraction finishes (which took 0.38s for gfl-restore, 1.35s for the 67.94 MB 201-file volume, and 2.40s for the 500,000-row PostgreSQL volume in our benchmarks), update your docker-compose.yml to point the service to postgres_db_data_restored declared with external: true:
services:
db:
image: postgres:16.6-alpine
volumes:
- postgres_db_data_restored:/var/lib/postgresql/data
volumes:
postgres_db_data_restored:
external: true
Bring the stack back online with docker compose up -d && docker compose logs db --tail 50. Because GNU and BusyBox tar -xzf run as root inside the temporary Alpine container, numeric file ownership is preserved automatically, including UID 70 for Alpine PostgreSQL images, UID 999 for Debian PostgreSQL images, and UID 1000 for node/n8n containers. If you ever migrate an archive across different base image families and encounter startup permission errors, see our Docker Volume Permission Denied (Linux PUID/PGID & UID Ownership) guide:

Production Verification Checklist & Backup Method Comparison Matrix
Before relying on nightly unattended automation, walk through these five verification gates and compare the three backup strategies summarized in the engineering table below:
| Backup Method | Archive Size (500k PG Rows) | Snapshot Duration | Restore RTO | Database Consistency & Production Use Case |
|---|---|---|---|---|
Read-Only (:ro) Alpine tar -czf (Static / Stopped Vol) |
106.9 KB (gfl-data) / 67.94 MB (201 files) |
0.19s / 1.93s |
0.38s / 1.35s |
100% Byte-Exact (MD5 8cc625c9.. & SHA-256 75f7ae0b.. match). Ideal for config volumes, SSL certs, static uploads, and stopped containers. |
Read-Only (:ro) Alpine tar -czf on Live PostgreSQL |
13.31 MB (raw PGDATA + pg_wal) |
0.84s |
2.40s (with WAL replay) |
Crash-Consistent Only (pg_control state = in production; triggers redo starts at 0/14F71F8). Risk of torn pages under heavy write concurrency. |
pg_dump -Fc --Z=6 Pre-Hook + rclone copy to S3 |
3.82 MB (3.48x smaller than raw tar) |
0.52s dump + 0.21s S3 sync |
1.15s via pg_restore |
100% MVCC Transactionally Consistent with zero container downtime and zero WAL crash recovery required on boot. |
- Manual Script Run: Execute
sudo /usr/local/bin/docker-volume-backup.shand confirm exit code0and empty local staging (ls -la /var/backups/docker). - Remote S3 Object Audit: Run
sudo rclone ls remote_spaces:my-production-backups/docker-volumesto verify exact byte counts in your bucket. - Retention Dry-Run Preview: Run
sudo rclone delete --dry-run --min-age 14d remote_spaces:my-production-backups/docker-volumes/before enabling live pruning. - Systemd Journal Audit: Inspect
journalctl -u docker-volume-backup.service --no-pager -n 30after the first scheduled03:00 UTCwindow. - Clean-Room Restore Drill: Extract one archive into a
*_restoredvolume quarterly and verify checksum parity before cutting overdocker-compose.yml.

Summary & Key Operational Takeaways
| Pipeline Stage | Verified Command / Configuration | Measured Lab Telemetry (Docker Engine 27.3.1, 2025-01-20) |
|---|---|---|
| 1. Volume Protection | Avoid docker compose down -v & docker volume prune -a |
Plain docker volume prune -f keeps gfl-named (0B); adding -a deletes named volumes immediately. |
| 2. Read-Only Archive | docker run --rm -v vol:/data:ro alpine:3.19 tar -czf ... |
67,944,048 B tarball created in 1.93s (MD5 8cc625c9c9198a5e19404ad65f48e027). |
| 3. Offsite S3 Transfer | rclone copy ... remote_spaces:my-production-backups/docker-volumes/ |
Uploaded in 0.90s (71.99 MiB/s) and restored in 0.74s with matching 201-file SHA-256 tree hash. |
| 4. Retention & Scheduling | OnCalendar=*-*-* 03:00:00 + rclone delete --min-age 14d |
Purged expired 19-day-old old_backup_20250101.tar.gz (1024 B) while capping 90-day S3 usage by -84.4%. |
- Mount Docker volumes read-only (
:ro) inside an ephemeralalpine:3.19container when runningtar -czf, and pair active relational databases with apg_dump -Fcpre-hook ordocker stopso restores never depend on unclean WAL crash recovery (0/14F71F8). - Store
rclonecredentials in/root/.config/rclone/rclone.conf(chmod 600) withacl = private, schedule daily runs with a persistentsystemdtimer (OnCalendar=*-*-* 03:00:00,RandomizedDelaySec=900,Persistent=true), and remove expired archives withrclone delete --min-age 14d. - Always restore into an isolated
*_restoredDocker volume and verifymd5sum/sha256sumparity before swappingexternal: trueindocker-compose.yml.
Docker Volume tar Snapshots, Live pg_dump & rclone Q&A
Is archiving a running PostgreSQL Docker volume with raw tar safe for production?
No. Backing up /var/lib/postgresql/data while PostgreSQL writes pages can capture torn heap files across checkpoints. Always run pg_dump (or pg_basebackup) first, or stop the writer container cleanly before archiving the volume with tar.
How do I automate 14-day retention on S3 or Cloudflare R2 Docker backups?
Pair a timestamped tar.zst or pg_dump upload via rclone copy with an rclone delete pass using --min-age 14d against your bucket prefix. Always verify exit codes before pruning older archives.
Why should I restore a Docker backup into a new _restored volume instead of in-place?
Extracting a tarball directly over a damaged live volume destroys forensic state and leaves no rollback path if you picked the wrong archive. Restoring into a fresh named volume lets you verify row counts and SHA-256 checksums before switching docker-compose.yml.
Run Prefilled Sizing Math & Download the 1-Page Runbook
Size PostgreSQL 17 shared_buffers for consistent pg_dump snapshots and generate a systemd pg_isready service watchdog.