> Notes.log/.sh/.env
rsync stems backup, version 7
#!/usr/bin/env bash
# stems-backup.sh — daily, run by systemd timer.
# version 7: switched from --whole-file to --inplace + --partial.
set -euo pipefail
SRC="/work/projects/"
DST="archive@nas.local:/mnt/array/stems/"
LOG="/var/log/stems-backup/$(date +%Y-%m-%d).log"
mkdir -p "$(dirname "$LOG")"
# --inplace: large session files (rpp, ardour stems) change in the
# middle, rewriting them whole defeats the snapshot dedupe on
# the NAS. with --inplace, btrfs/zfs see the diff and snapshot
# only the changed extents.
# --partial: don’t throw away 80GB of transferred stems if my
# wifi drops at 22:47.
# -aHAX: archive + hardlinks + ACLs + xattrs. lose any of these
# and the restore won’t match the original mtime/permissions.
rsync -aHAX \
--inplace --partial \
--exclude='*.peaks' --exclude='*.reapeaks' --exclude='.DS_Store' \
--exclude='Recorded/' \
--delete-after \
--log-file="$LOG" \
"$SRC" "$DST"
# Recorded/ is excluded on purpose. raw takes have their own pipeline.