Home > Linux > Data backups: diff, rdiff-backup etc.

Data backups: diff, rdiff-backup etc.

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.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: