Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Use rysnc to perform automatic backups UNIX
Tiger only hintOn Panther, I used to rely on Carbon Copy Cloner (CCC) to schedule a daily backup of my /Users directory to my external FireWire drive. Now CCC doesn't work properly on Tiger, I've developed a way of doing the same thing using the enhanced rsync command that comes with Tiger and supports forks. Hopefully this may help someone out while CCC is being updated.

To do this, enter the following in the Terminal:
sudo vi /etc/daily.local
Add the following to this file (or if it is empty, just type it in):
echo "Starting Daily rsync backup on `date`"
for FSYS in /Users
do
  /usr/bin/rsync -aE --delete $FSYS /Volumes/Backup
  if [ $? != 0 ]; then
    echo " ==> Error during rsync of $FSYS"
  else
    echo "rsync of $FSYS OK on `date`"
  fi
done
echo "Finished Daily rsync backup at `date`"
Now save this file (change /Volumes/Backup to match your desired backup location). Check it is owned by root:wheel and has permissions 750. That's it. launchd will now run this as part of the periodic daily command. If you want to run it manually, type:
launchctl start com.apple.periodic-daily
You can then check the output file in /var/log/daily.out. Hope that helps in the short term while CCC sorts itself out.
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[25,794 views]  

10.4: Use rysnc to perform automatic backups | 21 comments | Create New Account
Click here to return to the '10.4: Use rysnc to perform automatic backups' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use rysnc to perform automatic backups
Authored by: jmdevaney on May 16, '05 12:52:40PM
I would be careful of this hint for now... Rsync with the -E switch has been very unreliable for me so far in Tiger. See the following for more info: http://forums.macosxhints.com/showthread.php?t=38604

---
Jdevaney

[ Reply to This | # ]

10.4: Use rysnc to perform automatic backups
Authored by: atverd on May 16, '05 01:22:47PM

I'd strongly advise to avoid rsync from 10.4 too. With option -E it will always copy files with forks even if they not changed and this makes it practically useless. This is easy to see if you add -v into command line. I've opened bug on Apple's bug report page for this - may be they'll fix it with 10.4.1. So far stay with RsyncX.



[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: sparki on May 17, '05 03:22:43AM

I have found some issues also with Tiger's rsync and tar commands. I posted the details on the apple discussions.

http://discussions.info.apple.com/webx?50@714.EAlqaSlFV8Q.6@.68ae847b

I hope that link works. I am curious if anyone else has different results. If I am not doing something wrong, this really disappoints me. Apple is claiming these specific utilites will work.

---
-sparki
http://quadrant99.com



[ Reply to This | # ]
Try CCC again
Authored by: jodamiller on May 16, '05 02:41:29PM

I also had a problem getting CCC and SilverKeeper (LaCie's backup program) to work. When it'd try to begin, it'd ask for my admin password, then stall until I forced quit. I read it was something to do with the way Tiger authenticates the password.

However, after a security update, both CCC and SilverKeeper were working for me again. I think the authentication is now again working for those two programs. So, you may want to give CCC another try.



[ Reply to This | # ]
Try CCC again
Authored by: tciuro on May 19, '05 09:39:12PM
I had no issues with SilverKeeper 1.1.3, which is supposed to be Tiger-compliant. Give it a try and see what happens:

http://www.lacie.com/silverkeeper

[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: jeremyrh on May 16, '05 02:51:35PM

SuperDuper still seems to work, as far as I can see!!



[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: hypert on May 16, '05 02:52:19PM

Doesn't this leave all of your backed-up files owned by root?

I think it might be better (no matter which program you use) to setup a personal cron job. That way, all files will be owned by your userid.



[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: the1truestripes on May 16, '05 04:08:54PM

They should be owned by the "correct" user, he passed -aE to rsync, the rsync man page says -a is "archive mode, equivalent to -rlptgoD". The -o preserves the ownership.

[ Reply to This | # ]

10.4: Use rysnc to perform automatic backups
Authored by: atshoom on May 16, '05 04:36:06PM

about CCC i've found an hack for it to work on tiger:

it seems it hangs just after entering the password so i just logged a session as root and started CCC
result: no password request and CCC just went fine.



[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: Wayne_S on May 16, '05 04:44:01PM

I also had CCC hang on entering my admin password. I started the Activity Monitor and found a second CCC process. The first was called "carbon Copy Cloner" and the second "Carbon Copy Clon." Unfortunately, forcing one (or both) to quit was no help at all. In fact, the app refused to die. I probably should have tried to kill the process from the Terminal, but at the time, the power button was closer so ....

---
Every rule has an exception. Especially this one.



[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: baltwo on May 16, '05 06:37:38PM

See <http://forums.bombich.com/viewtopic.php?t=5264> for a workaround to execute CCC without enabling the root user.



[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: ZZamboni on May 16, '05 05:10:57PM
I use rsyncbackup for doing backups. It uses rsync, but offers a large number of options to customize backups. It works nicely with RsyncX.

[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: vocaro on May 16, '05 11:56:17PM
There is also rdiff-backup, which works quite well. It creates a mirror and a complete incremental history on each new backup, so you can roll back to any point in time. You can install it through Fink, but be sure to get version 0.13.6 or higher. (0.13.4 doesn't work on Mac OS X.)

[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: bluehz on May 19, '05 07:54:02AM

The only version I see on Fink is 0.13.4-2



[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: Ross T on May 16, '05 06:32:55PM

AFAIK, there is no trouble-free way to rsync remotely between Tiger and Panther machines. Tiger's rsync 2.6.3 requires a Tiger machine at each end; RSyncX works but fills the Tiger machine's logs with "HFS: /rsrc paths are deprecated (..namedfork/rsrc)" messages. I hope I'm wrong and somebody can point to a build of rsync that is happy with both 10.3 and 10.4.



[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: t0fukrunch on May 16, '05 07:39:40PM
I was able to compile the OS X 10.4 rsync package from Apple's Darwin site on a GNU/Linux box. I imagine it would compile fine on a Panther machine as well.

[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: extra88 on May 16, '05 11:02:13PM
Could you provide some tips on how you were able to compile the Darwin rsync code? I tried it on a Jaguar machine and was able to compile the "vanilla" rsync code (in rsync-2.6.3.tar.gz) but didn't see how to use the files in the patches directory or how to use the provided Makefile. Did you have to make use of any other portions of the Darwin source code to get it to compile?

[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: grasshoppermouse on May 17, '05 05:42:22AM
I was bitten by the following: if /Volumes/Backup is a removable drive, like a firewire drive, and it gets unplugged, rsyncx will create a folder in /Volumes named 'Backup', and write the files there. If you are mirroring the drive, as I was, this will completely fill the source hard drive, causing all kinds of problems. To help prevent this, I bracketed the script with an if-then statement checking that the backup drive exists before writing to it, as follows:

if [ -d "/Volumes/Backup/" ]; then

rsync code here

fi
Although I am no Unix expert, the following code seems to work well:

# Begin Backup Script
if [ -d "/Volumes/Backup/" ]; then
PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec:/usr/local/bin
export PATH
host=`hostname -s`
echo "Rsync to Backup"
sudo /usr/local/bin/rsync -a --delete --eahfs \
--exclude="/dev*" --exclude="/private/tmp*"\
--exclude="/Network*" --exclude="/Volumes*" \
--exclude="/private/var/run*"\
--exclude="/afs*" --exclude="/automount*" "/." "/Volumes/Backup/"
fi
# End Backup Script


[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: ukkarhu on May 17, '05 04:37:56PM
That's a very valid point - and one I fell for. To include this into my original hints, the code is:

# Local Daily script
# Andrew Padley
#
echo "Starting Daily rsync backup on `date`"
VOLUME="/Volumes/Backup"
if [ -d $VOLUME ]; then
for FSYS in /Users
do
        /usr/bin/rsync -aE --delete $FSYS $VOLUME
        if [ $? != 0 ]; then
                echo " ==> Error during rsync of $FSYS"
        else
                echo "rsync of $FSYS OK on `date`"
        fi
done
else
        echo "==> Backup Volume was not present"
fi
echo "Finished Daily rsync backup at `date`"
Funny thing with rsync is that you seem to need to run it twice to get it to sync properly - something fishy going on here somewhere...!!!

[ Reply to This | # ]
10.4: Use rysnc to perform automatic backups
Authored by: diroussel on May 17, '05 05:51:56PM

Put the backup script on the removable drive, then if it's not connected cron can't run it.



[ Reply to This | # ]
10.4: Building rsync 2.6.3
Authored by: Ross T on May 17, '05 07:19:09PM

I compiled it on Panther by running (as su) "make" and then "make install" from the rsync-20 directory (not the rsync directory inside rsync-20). The resulting rsync accepts the -E argument and displays its version as 2.6.3, but it does not copy extended attributes to/from a Tiger machine.



[ Reply to This | # ]