diff: differences between source and destination folder
Imagine you already some 1:1 backup, e.g. your data partition copied to a backup disk. You did that without using rdiff-backup or similar, just a plain copy. If you now want to see differences between the source and destination directory the following diff command might come in handy. It lists the differences in content between dir1 and dir2 – recursively and with modified output (we assume you just want to know which files changed, and not how files changed). This could be useful to see which files “disappeared” since doing the backup (accidentally deleted etc.)
diff -ur dir1 dir2 > diff.txt
rdiff-backup: easy to use incremental backups
When backing up bigger portions of data, incremental backups can greatly speed up the process. rdiff-backup provides such incremental backups and is fairly easy to use. Further, rdiff-backup always represents the latest version of your content in the backup, alongside reverse diffs to go back to older versions.
The rdiff-backup syntax works the “include all content in the specified source directory to the backup, exclude only additionally specified files/folders”-way. For my personal data backup I do it the other way round, as I only have a hand full folders to include in the backup, which are distributed all over the file system. I first include all locations I want backupped, then exclude everything else (“/**”) and specify the file system root as source directory. The following command is adapted to my personal needs (and really only backups data, no system configuration or else), so you will need to adapt it to fit your needs:
rdiff-backup --include /media/data/documents --include /media/data/pictures --include /media/data/music --include /media/data/new --include /media/data/tools --include /media/data/virtualOS --include /home/xxx/.thunderbird --include /home/xxx/git_repos --exclude /** / /path/to/backup
You can include your data partitions here, as well as do a data backup of essential parts of your system by including /etc, /home, /root etc.
