Incremental backup with hard links using rsync --link-dest
rsync snapshot backups | daily backups without using much space | time machine style backup linux | rsync incremental backup | rsync | link-dest | backup | hardlinkCaution: This command changes the system. Understand what it does before you run it.
rsync -a --link-dest=/backup/example.com/aktuell /var/www/vhosts/example.com/httpdocs/ /backup/example.com/$(date +%F)/ && ln -sfn /backup/example.com/$(date +%F) /backup/example.com/aktuellCreates a folder named after today’s date under the backup path. Files that have not changed since the last backup are created as hard links to the previous version via --link-dest and use no additional space. Afterwards, the aktuell symlink points to the new backup, which serves as the comparison base for the next run.
Note: Backup and previous version must be on the same filesystem. Old date folders can be deleted individually without damaging other snapshots.
Open question before approval: Prüfen, dass rsync beim allerersten Lauf ohne vorhandenes aktuell nur warnt, eine Vollkopie anlegt und mit Exitcode 0 endet, damit der Symlink gesetzt wird.
Also searched as
- rsync snapshot backups
- daily backups without using much space
- time machine style backup linux
- rsync incremental backup