Skip to content
Backup Recipes

Copy-paste recipes for backups that can actually be restored.

Rsync mirror with deletions

Rsync mirror with deletions
A mirror that follows deletions, with a dry run first.

A mirror is not a backup on its own, because it copies mistakes too. It is still the first building block: a second copy that is cheap to keep current.

rsync -aHAX --delete --dry-run /srv/data/ backup:/srv/mirror/
rsync -aHAX --delete /srv/data/ backup:/srv/mirror/

The trailing slashes matter: with them rsync copies the contents of the directory, without them it creates the directory inside the target.

#rsync#mirror