Incremental backups with rsync


I’ve been using rsync for a while now for doing backups.

I currently run my main pc, and a network pc (acting as a NAS), and use rsync to backup files between each pc. Here’s an example command.

rsync -rvt -pog --delete --progress --itemize-changes --stats "/media/storage/music/" "/media/backup/music/"

  • -r = recursive (to include sub-folders)
  • -v = verbose (so it shows the the output as it happens)
  • –progress = show the progression of files being copied
  • –itemize-changes = output a summary at the end of the sync
  • –delete = delete files in the destination that no longer exist in the source
  • –stats = gives some additional transfer stats at the end

Preserving settings:

  • t = time (preserves the timestamps of the files)
  • p = permissions (preserves the permissions of the files)
  • o = owner (preserves the owner of the files)
  • g = group (preserves the group of the files)

I put the above command, along with 4 or 5 others into one file. I can then run it on a schedule via cron (more to come on this). Here’s my rsync file.

Dry run

If you’re worried about copying or updating files etc… you can add “-n” to the command and it’ll perform a dry run.

More to come

There are plenty more settings you can implement. Just open up a Terminal and type “rsync” for a list of them. I’m currently working on getting it to work via SSH. That way I can backup files remotely (for example between my pc and my brother’s pc).

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts
Handling CSS and JavaScript using Rewrite Rules in IIS
Securely deleting files in Ubuntu

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to leave a comment!