Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using a mac pro and have my OS/application files on one hard drive and other files on another internal hard drive. Before I got the latter drive, I cloned the drive with the OS to an external HD using SuperDuder!

Now that I have my OS/apps and storage on seperate HDDs, how can I back up JUST my files to the external HD? Software like Time Machine and SuperDuder seem to log changes, which would not work...it sounds like they delete files that are not on the drive you are backing up from.

I also don't want the clean OS to be altered in anyway.

share|improve this question
    
It sounds like you want to archive files, not just backup the current state of your system? Actually, Time Machine keeps most of the files, even after you delete them from your Mac, until the backup disk is full. But you're right: Time Machine is not an archive tool, but a backup tool, and it might delete files from the backup sooner than one might think. Especially files that existed on your Mac for only a few days might be deleted from the backup long before the backup disk is actually full. (If your question is indeed about archiving, then please change the title?) –  Arjan Nov 17 '09 at 7:15
    
You should probably tell me which one I'm trying to do. ;) In retrospect, I probably should have just used Time Machine, but I was waiting on the 2nd hard drive to move all my files over. I also like that I have a bootable backup. The plan was to keep it pristine until I got new software I was afraid of losing, then update the clone. However, I was also using the external to transport files, so a few files are different. I want to update the existing files on the external HD without losing the OS/apps and other files...there must have been a better way to do this! –  Kato Nov 17 '09 at 8:46
add comment

2 Answers 2

up vote 1 down vote accepted

Like SleighBoy said, rsync is definitively the tool you are looking for. Since it can be scary at first look, due to its many options, i'll suggest the most important to you, based on your needs. The basic syntax for local backups is:

rsync [OPTION..] SRC.. DST

Generally the --archive/-a option is used because it encloses some other common options like --recursive and options to preserve file permissions.

One option the you don't have to use is --delete because otherwise rsync will delete every file that is in the destination DST but is not in the sources SRT.

You probably want also the option --relative/-R. It enables the use of relative paths. From the man page:

...this means that the full path names specified on the command line are sent to the server rather than just the last parts of the filenames. This is particularly useful when you want to send several different directories at the same time. For example, if you used this command:

rsync -av /foo/bar/baz.c /tmp/

... this would create a file named baz.c in /tmp/ . If instead you used

rsync -avR /foo/bar/baz.c /tmp/

then a file named /tmp/foo/bar/baz.c would be created — the full path name is preserved. To limit the amount of path information that is sent you can insert a dot and a slash into the source path, like this:

rsync -avR /foo/./bar/baz.c remote:/tmp/

That would create /tmp/bar/baz.c on the remote machine.

You also need the option:

--exclude=PATTERN

One very handy option is --dry-run that just simulates the transfer. You can use it to test your rsync commands.

The following options can be used to make the backup process verbose:

--stats --verbose --human-readable --progress

Summarizing, if you need to backup the folder /home/user into the folder /media/backup excluding the folders /home/user/lib and /home/user/dir1/dir2 then you can use:

rsync -aRvh --exclude=/home/user/lib --exclude=/home/user/dir1/dir2 /home/user /media/backup

that will recreate the whole directory hierarchy of /home/user into /media/backup.

share|improve this answer
    
That's great, thanks for all the details! Are there any downsides to using this program over another? Will it actually be more of a hassle to use it rather than just manually dragging files back and forth? I also have things like FCP scratch disks that will need to be updated on the backup drive. –  Kato Nov 17 '09 at 8:34
    
The main advantages of rsync over manually moving files is that rsync automatically detects which files are changed and updates them by sending only the differences. If you need to backup other folders just list them after the options, i.e. rsync -aRvh /dir1 /dir2 /dir3 /destDir . –  mrucci Nov 17 '09 at 12:40
    
So if a file is newer on the backup drive, but the older version is on my desktop, will it change the new file to the older version??? (assuming SRC is desktop, DST is backup) –  Kato Nov 19 '09 at 4:30
    
Yes, but you can change this behaviour by using the option --update. From the man page: "the option --update forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file". –  mrucci Nov 19 '09 at 5:21
    
That's a relief! Is there also a way to then update the old file on the source? –  Kato Nov 19 '09 at 7:28
show 2 more comments

If you want to keep it simple, rsync will provide you with many options for backup and what to keep/delete.

share|improve this answer
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.