Keeping 2 drives sync’ed with rsync on Linux

I have an external USB HDD and I like to keep it synchronised with my desktop for backup reasons. I find the easiest way to do this, is to use rsync:

> sudo apt-get install rsync
> rsync -avu /source/ /dest/

For example:

> rysnc -avu /media/externaldisk/ /home/chris/diskbackup/

Will increment copy everything (ignoring older files) from /media/externaldisk to my /home/chris/diskbackup folder.

The options are:

  • a – Archive mode – Will retain the folder/file properties, such as owner, permissions, etc.
  • v – Verbose – Output the progress to the screen (so I know its still working)
  • u – Update – Only update files that have a more recent file modified date.

 

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>