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

Easy and complete folder backups System
"hellmachine" posted a one-line terminal command in this MacNN forum which will copy a given directory, including all hidden files and resource forks, to a backup location:
sudo ditto -vR -rsrcFork /Users /Volumes/Backups/Users
This example would back up the Users directory to a volume named "Backups". The -rsrcFork option will handle the resource fork of the files during the copy.

I have not tested this myself, and I cannot find any documentation ("man ditto") on the -rsrcFork option. Use at your own risk, but it doesn't look too threatening, as ditto is a copy command.
  • Currently 2.00 / 5
  You rated: 2 / 5 (2 votes cast)

Easy and complete folder backups | 5 comments | Create New Account
Click here to return to the 'Easy and complete folder backups' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
mention of -rsrcFork option
Authored by: snoozer on Jun 12, '01 10:16:23PM

Although 'man ditto' doesn't mention the -rsrcFork option, if you just enter a 'ditto' command (with no arguments), the usage message does mention it.


[ Reply to This | # ]
mention of -rsrcFork option
Authored by: BraindeadMac on Jun 13, '01 09:57:17PM
Yes, the ditto command with -rsrcFork works very nicely. It seems to handle symbolic links as well as directory recursion and hidden file/folder structures.

On the other hand, the CpMac command chokes on HFS aliases and symbolic links. I haven't tried to make a bootable OS X disk yet using the ditto command but it seems promising.

[ Reply to This | # ]

mention of -rsrcFork option
Authored by: hembeck on Dec 11, '01 09:17:02PM

How does command work? I've tried using this to copy my user directory over to a firewire hard drive. Instead of copying over to the firewire drive, it makes a duplicate of my user directory, inside my user directory.


[ Reply to This | # ]
Need help
Authored by: hembeck on Dec 12, '01 11:52:17PM

Okay, so I tried this again, and now it said that it made a copy, but mot to the destination volume. I believe that it has made a copy and placed it somewhere on my HD, because because 1.5GB lighter. Problem is I haven't a clue where it could have placed it one my HD. I've tried Sherlock, but it can't find a thing either.



[ Reply to This | # ]
Easy and complete folder backups
Authored by: comprock on Aug 25, '04 10:07:48AM
For those that want to schedule these backups, you can stick it in your /etc/crontab like so.

# back up users directory @ 9:15 every morning
15 9 * * * /usr/bin/ditto --rsrc /Users /liu/lusers

[ Reply to This | # ]