Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In light of a recent hardware failure, I've decided that it's time to be a little less lax regarding back-ups.

What I have:

  • An Ubuntu 10.10 'server/NAS'
  • A MacBook 5,2
  • A WD external HDD

The server and the MacBook are permanently connected by Ethernet.

I have a directory on the server that I'd like to keep synchronized with the external drive that I plug in from time to time. The Ubuntu filesystem is ext4 and the external drive is HFS+ (Mac OS Extended [Journaled]). It should be noted that this is not case-sensitive. I'm unsure if this is a problem. If it is I can reformat the external HDD so that it is.

It should also be noted that OS X 10.6 ships with a fairly old rsync, ver. 2.6.9. I believe there are some problems with this concerning the handling of resource forks and other things.

So then, what is the best way to proceed?

  • Should I be doing rsyncs across the network? If so some guidance re: how to achieve this using the CLI would be appreciated (I've read the rsync man page numerous times and can't quite get my head around it).
  • Or should I be installing a kernel module so that I can just plug the HFS+ formatted drive into the server and it be read & writeable in Linux? Again, some rsync CLI guidance would be great.
  • Or should I be doing something else entirely?

Cheers.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

Yes, rsync is the answer.

Having the drive plugged in locally is going to be a lot faster than the network, but for the purpose of doing backups, I would actually recommend leaving the hardware in place. Do the slower thing and transfer it over the network ... remote to remote if need be, so that you don't break anything by touching it.

There are four main parts to your rsync command. First, the transport mechanism. For local to local transfers this is skipped. If any of the sides are remote, you usually specify a tranfer agent like rsync -e ssh to use SSH transport. After that you specify a source for your files (end with a slash if giving a directory!) and then a target (again end with a slash syncing directories!). So we have rsync -e ssh machine1:/source/folder/ machine2:/source/folder/ so far. Then you can add options like what to skip using --exclude PATTERN, over the wire compression using -z, maybe the -a archive option to handle recursive stuff, matching permissions and such, then -v or --progress if you want to see details or progress as it goes along.

Sample:

rsync -avze ssh ubuntu:/path/to/source/files/ osxhost:/path/to/backup/drive/
share|improve this answer
    
Sorry for taking so long to get back to you Caleb. Cheers for the answer. I've decided to bypass the network and just plug in the drive. Therefore I've partitioned a bit of it as ext4 for this purpose. –  boehj Apr 19 '11 at 9:15
add comment

The basic command I use is rsync -vaP user@host1:/files/ user@host2:/files/. I occasionally use --exclude-from, --delete, --delete-excluded.

A nice wrapper around rsync for backup purposes is dirvish.

share|improve this answer
    
Thanks for the link. I'll take a look at that. –  boehj Apr 19 '11 at 9:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.