Sunday, March 30, 2014

Taking backups on Linux

With RSYNC around, who needs any other backup software on Linux!

I have found rsync to be quite the handy tool for backing up my data on external storage devices.

Here is one of the commands that I use regularly on my Mageia system, for backing up my movies from one external hard disk drive to another -
[mrigs@localhost ~]$ rsync -azv --delete /run/media/mrigs/TheGrid/yemt/ /run/media/mrigs/TOSHIBA\ EXT/yemt/
where

-a is for
  • Recursive mode
  • Preserving symbolic links
  • Preserving permissions
  • Preserving timestamp
  • Preserving owner and group

-z is to enable compression

-v is for verbose

--delete is used for deleting files in the target directory that are not present in the source directory

/run/media/mrigs/TheGrid/yemt/ is my source directory in external hard disk 1

/run/media/mrigs/TOSHIBA\ EXT/yemt/ is my target directory in external hard disk 2

Like any other Linux command, there are several ways to use this command for your varied needs. "How to Backup Linux? 15 rsync Command Examples" is an excellent resource for finding some of the most frequently used rsync scenarios.

Then there is GRSYNC, for those who prefer the GUI way to do things.