Search

Top Posts

Comments

  • James: Well, it hasn’t crashed on me yet, and I’ve been using it for at least 2 months now…
  • Dasher: Any experience creating a RAM disk, specifically for helping iTunes run faster? I am on a 2006 Imac 21″...
  • sam: I have os 10.5.8 but i dont have this. Wtf?
  • MMES: If you customize the equalizer setting in iTunes, those settings will carryover to the iPhone and you can enjoy...
  • hadjime: Doesn’t work on me… i remove the file and then i open photo booth and it’s still wotking

Categories

Recent Posts


Command Line Back Ups in OS X

These days there are no shortage of ways to backup your Macintosh. Probably the most popular method available to an end-user is Apple’s Time Machine (first introduced in Mac OS X 10.5). Personally, I was very impressed with the ease of use offered by Time Machine, but I am a command line junkie so I must report on the alternatives. Read on for a few methods that you can use (from the command line) to back up your Mac.

1) ditto

sudo ditto -X src_directory dst_directory

Ditto is a built-in part of Mac OS X and ships with all versions. Ditto is fairly robust and can backup your files preserving both ownerships attributes and resource forks. One nifty feature that Ditto offers is it’s ability to “thin” binaries of their PPC or i386 code. For instance, if you own an older PPC Macintosh you can add –arch ppc to your command line options and every binary file that is backed up will be stripped of it’s x86 binary code. This will result in smaller backups.

2) rsync

sudo rsync -xrlptgoEv --progress --delete src_directory dst_directory

Rsync is a versatile and popular method for performing backups not just on the Mac but on Linux and Unix servers across the “IT-globe”. Rsync can do everything you need to perform a reliable backup of your OS X system, including resource forks and preservation of the ability for your hard drive to be “bootable”. An in depth look at rysnc’s abilities can be found here.

3) asr

sudo asr -source src_directory -target dst_directory -erase -noprompt

asr, or the Apply Software Restore utility is yet another excellent and efficient way to perform a backup. ASR can do everything that Ditto can do plus it has the ability to copy a hard disk at the block level. The block level is the “lowest” possible form to access a hard drive and provides true 100% replication of data. The block level functionality of ASR must be performed on hard disks that are not currently mounted in your operating system. This typically means booting from a recovery disk, usb install or similar.

4) hdiutil

sudo hdiutil create dst_image.dmg -format UDZO -nocrossdev -srcdir src_directory

If you have ever wanted to create a simple and single file backup of your Macintosh, then hdiutil is for you. Hdiutil performs a backup to a single (optionally compressed) disk image file that can be restored using Apple’s Disk Utility software.

Posted by: William Pearson

Share

Save big on Mac Deals from Amazon.com

Comments:

Comments: 5

Pingback from Command Line Back Ups in OS X | The Black Ball
Time: February 19, 2009, 5:25 pm

[...] The rest is here:  Command Line Back Ups in OS X Share and Enjoy: [...]

Comment from Tim Burkhart
Time: February 21, 2009, 8:58 pm

Excellent tips for those of us who haven’t upgraded to 10.5.

Comment from til
Time: March 2, 2009, 6:57 am

Thanks for this useful overview!

(esp. the rsync line :-)

To create archived & compressed backups (of mid-sized directories, not the entire system i guess) see:

Combine find & tar to create archives

http://codesnippets.joyent.com/posts/show/1962

Thanks!

Comment from markus
Time: April 20, 2009, 2:09 pm

The block level is the “lowest” possible form to access a hard drive and provides true 100% replication of data. The block level functionality of ASR must be performed on hard disks that are not currently mounted in your operating system. This typically means booting from a recovery disk, usb install or similar.

Comment from kumar
Time: May 13, 2009, 8:17 am

Rsync is a versatile and popular method for performing backups not just on the Mac but on Linux and Unix servers across the “IT-globe”. Rsync can do everything you need to perform a reliable backup of your OS X system, including resource forks and preservation of the ability for your hard drive to be “bootable”. An in depth look at rysnc’s abilities can be found here.

Write a comment






February 19th, 2009