brent
Restic will not create NEW backups of files that are cryptographically the exact same file in the same source location as one already in an existing snapshot, however same file in a different source location is still considered unique.
Restic will not delete files from snapshots because those files no longer exists on your system. They will not be tracked in NEW snapshots but if a prior snapshot contained them, they remain. The whole point being if it turns out you really wanted that deleted/older version of that file, you can restore from another "snapshot" in time.
Not even rsync which provides 0 redundancy within the backup itself will delete files no longer present by default. It needs the flag --delete
in order to do this. Restic may have a similar flag but I doubt it, doesn't make sense to me for restic to do this given the whole point is maintaining snapshots.
When a snapshot is forgotten from restic it is not actually deleted, you have to prune to reclaim space. I have aliases for this and much more.
My backup aliases
I use aliases so I do not have to remember stupidly long commands. I also have rsync
and restic
backups because I do not want to trust any one program. I have 2x restic and 1x rsync backup, all on separate drives.
alias rsynchome="rsync -avh --delete --exclude-from='/home/harvey/.backupexclude' /home/harvey /mnt/rsync/Backup/Home"
alias restichome="restic backup /home/harvey --exclude-file='/home/harvey/.backupexclude' -r /mnt/restic/Backup/Home"
Both restic
and rsync
have the ability to exclude things from being backed up that are listed in a text file. My .backupexclude
plain text file contains the following:
.audacity-data
.cache
Desktop
Downloads
.kde
.local
.lyrics
.nv
.pki
repository/full
.steam
.steampath
.steampid
Templates
.vscode
.wget-hsts
Then you have forget and prune:
Every now and then I run these to clean up.
Forget all snapshots except the last 8 (keep as many as you want). Might seem confusing but if something is forgotten it doesn't actually reclaim the space on your drive, for that you need --prune which will delete all unreferenced data (data from the forgotten snapshots).
alias resticprune="restic -r /mnt/restic2TB/Backup/Home forget --keep-last 8 --prune
This makes sure you have a valid restic backup and is recommended to be run after a prune.
alias resticcheck="restic -r /mnt/restic2TB/Backup/Home check
For anyone that reads this the full documentation on restic is much, much more verbose here