Syncing With Rsync

rsync is a great Unix (including Linux and Mac OS X) utility for archiving and synchronizing large amounts of files which don’t change very often. Instead of transferring all the files each time you do a backup, rsync will only transmit the difference between your computer’s files and the backup on Strongspace. Obviously this makes backing up much faster.

Installing rsync

rsync comes pre-installed on many operating systems (including Mac OS X), so you may not need to install anything. However you can download the latest stable version of the rsync source code from the rsync website, configure, make and install rsync using the instructions provided in the distribution if necessary.

The syntax

The basic command for rsync to make an archive of part of your local file system onto your Strongspace account is (all one line):

rsync -rltvz /local/path/to/stuff login@subdomain.strongspace.com:/remote/path/to/stuff

Putting it all together

So, taking this little chunk of knowledge, let’s make a backup of a directory on my computer to my Strongspace account. For this demo, I’m using my own Strongspace account (indent.strongspace.com) – you’ll have to substitute your own username/subdomain as needed.

  1. type rsync -rltvz ~/Desktop/SSDemo/ indent@indent.strongspace.com:/home/indent/SSDemo/ at the command line
  2. enter your password when prompted
  3. watch the files being transmitted to the Strongspace server
  4. smile

Some notes

  • I’ve also made a Quicktime movie which runs through the above process.
  • This can only be done by the account owner, not by any of the sub-users on an account (they do not have an SFTP/SCPOnly shell)
  • There’s far too many options for rsync to document here, so if you’d like to read more, refer to the rsync manpage and rsync home page.
  • This RsyncX Introduction has some nice hints.
  • There are a few GUI rsync applications out there, including RsyncX (Version Tracker) for OS X.
  • Media Temple customers will need to add the ”-e ssh” option when backing up their files from their MT shell to Strongspace

Update Feb 2006: The a option is a little bit evil in the context of Strongspace, because it does things like retain ownership and groups, which can make certain parts of our web browser based UI fail (eg, can’t delete a file), so I’ve updated this article to use -rltvz instead, which means it’s recursive, copies symlinks as symlinks, preserves times, provides verbose feedback, and compresses the data for transmission.