Rsync - Backup All Your Data With a Single Terminal Command

7

Comments

+ Add a Comment
avatar

lmiller

this command is fantastic. makes my job much easier! however, on some projects i'm required to back up data to two additional drives. currently i'm running the command twice for each drive. any way to run the command once and back up to two drives?

avatar

lmiller

this command is fantastic. makes my job much easier! however, on some projects i'm required to back up data to two additional drives. currently i'm running the command twice for each drive. any way to run the command once and back up to two drives?

avatar

Jason Schroeder

Hello!

First, Cron is a great utility but you have to be careful when using it. It will precisely automate scripts containing things like rsync. However, the one major danger you can really encounter with rsync is if the computer is scheduled to do them during a time you have a volume offline during a volume to volume rsync.

In the event the volume is offline, OS X will copy your data to /localHD/Volumes/target/. This means if your source data is larger than your internal hard drive, you will fill it up and your system will most likely crash. I suggest you craft or either have someone assist you in crafting a script that contains a check to see if the volume is actually there before running the rsync.

Second, regarding the "-E" error: permissions with filesystems are reaching a synergy where ACLs and POSIX can work in a strange random harmony in both Active Directory and Open Directory environments. It isn't perfect, and until it is, you will *always* see changes in the way variables behave in the application. As OS X has been tuned and improved over the years, certain functions have changed. Some may be added. If filesystems like ZFS become popular, you will probably even see added variables for stuff like snapshots.

Apple's biggest leaps in the way they stored resource forks came in 10.4, when special utilities or commands were phased out and made such that a regular copy brought everything with it.It is always advised to do tests and use the "-n" flag as much as possible. It will give you a clear idea of what to expect without actually committing. 

Hope this helps!

avatar

fotmasta

rsync version 2.6.0 protocol version 27

The -E option is in the man page, but throws an error when invoked.

'rsync: -E: unknown option'

avatar

JBracy

The -E option includes Mac specific file data including resource forks. Not so imortant for jpeg files and such, but vital for other types of files. Do a "man rsync" in the terminal for more info.

avatar

allenwatson

Another Unix utility, cron, schedules things to run at given intervals. And a free GUI utility, cronnix, will help you schedule cron runs for any command line or script. Just type the rsync command into cronnix and set the intervals for running it.

avatar

rickpdx

This is great! How do I create something automated so I can run this once a week to back up my entire hard drive, or better yet, create this to run automatically once a week?

Log in to Mac|Life directly or log in using Facebook

Forgot your username or password?
Click here for help.

Login with Facebook
Log in using Facebook to share comments and articles easily with your Facebook feed.