I was searching the net to find a way to do a complete backup of my linux machine (not a server) and restore everything anytime.
I started with the most linked guide on every thread, http://www.mikerubel.org/computers/rsync_snapshots/index.html and I thought that this type of backup was an incremental backup, after another day of research I found What's the differernce between differential and incremental backup in terms of rsync command? and other discussion, but I am not sure what I am really doing.
Following the guide and the posts I decided to try with a single folder (before backup the entire system) called source
rsync -av --delete /home/user/source /home/user/backup/backup0/
then I added and removed some files and did the backup three more times
rsync -avH --delete --link-dest=/home/user/backup/backup0 /home/user/source /home/user/backup/backup1 rsync -avH --delete --link-dest=/home/user/backup/backup1 /home/user/source /home/user/backup/backup2 rsync -avH --delete --link-dest=/home/user/backup/backup2 /home/user/source /home/user/backup/backup3
I thought that with this type of backup I was going to have something like:
So if I wanted to restore the content of "backup3" the #1 e #2 were needed, but I deleted them and then restored the backup3, and everything was back in place. So I ran
user@user:/backup$ du -sh * 450M backup0 620K backup1 624K backup2 628K backup3
It looks like a differential backup, not an incremental, but I thought that to be differential I would had to set for every backup
My question is: Am I mistaking something? Is there a better way to backup a complete system using rsync?
P.S: the destination device is going to be an external drive with the same filesystem.