Backup with Rsync

February 25, 2010

Everyone needs to make backups. Some people copy their most important files to an external hard disk or DVD, others use automated software to do the job for them. Many Mac OSX users use Time Machine, Apple’s backup application. I think i don’t have enough control when i use it. So i started looking for a program that did what i wanted it to do, make incremental backups from folders that i chose, and have the option to exclude files or folders from the backup.

Rsync, a command line (cli) program that’s installed by default on almost all UNIX based operating systems (so also Mac OSX and a whole lot of GNU/Linux distro’s), does the job quite good for me.

rsync -avzru /Volumes/LACIE/ /Volumes/LaCie\ 1 --exclude "/Applications/**" --exclude ".*" --exclude ".*/" --exclude ".*/**"

that’s what i type in the terminal.

  • rsync is the program.
  • -avzru means ‘archive’, ‘verbose’ (more output to the command line), ‘compress’ (use compression to decrease traffic if you use rsync over a network), ‘recursive’ (go into all folders), ‘update’ (don’t overwrite newer files)
  • /Volumes/LACIE/ this is the source external hard disk (notice the “/” at the end!)
  • /Volumes/LaCie\ 1 this is the destination external hard disk. It’s called ‘LaCie 1’, and the backslash is there to see the space as part of the path. (notice that there is no “/” at the end)
  • –exclude “/Applications/**” here i exclude the folder ‘Applications’ from the backup
  • –exclude “.*” –exclude “.*/” –exclude “.*/**” also exclude all hidden files and folders

that’s it 🙂



2 Responses to “Backup with Rsync”

  1. digihash Says:

    Reblogged this on digihash and commented:
    I like the idea of working with rsync to backup the files and folders that I choose. But I’m kind of worried with the security. So I searched for a method to use rsync over an SSH secured connection.
    This method is very well explained on this webpage:
    I think this is a better and more secure solution to backup my files and folders over a network connection.

  2. Toon
    Thanks for the description of the sync command tool, that did it for me and I’ve read many solutions with excluding hidden folders but nothing worked for me. have automated it with Automator and a calandar workflow and it works great.

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: