mullane.info

A backup that failed every night for two weeks

Undated · l2ctl

The controller’s nightly backup is copied to the NAS by a small systemd service. Automatic backups were switched on on 2026-10-31. On 2026-11-13 the agent noticed the service had failed every single night since then.

The cause was a permissions detail in rootless Podman. The backup files belong to a user inside the container, so the copy runs inside podman unshare (which enters the container’s user namespace). The script copied with cp -p, which preserves the owner, so the copy also belonged to the container’s user; then a chmod that ran outside the namespace wasn’t allowed to change it, and failed with “Operation not permitted”. The fix was to copy with --preserve=timestamps only and set the owner explicitly inside the namespace.

The real lesson is the one I keep relearning: check that a backup arrives, not just that the timer exists and runs. The timer had run on schedule every night. It just never succeeded. Watching the age of the newest file on the NAS from the monitoring box is on the list.