Backup zip and split script for OS X

Richard Pieri richard.pieri-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Mon Dec 21 00:43:19 EST 2009


On Dec 20, 2009, at 7:37 PM, Chris O'Connell wrote:
> 
> But I have read a variety of information in the man pages that says there is
> a file split limitation of 2gb.  Can anyone offer any alternate
> suggestions?

Don't use zip for backups.  It does not retain ownerships or permissions.  Usually I recommend tar but on OS X you should use ditto to ensure that you also retain any resource forks that might be kicking around.  Ditto uses cpio archives by default.

 cd /Users
 ditto -c -z . - \
   | split -b 8192m - /Volumes/Seagate1TB/backup-`date.....`.cpgz.

To restore you need to catenate all the pieces together:

  cat backup-*.cpgz.* >> /path/to/staging.cpgz

and then extract with pax:

  cd /Users
  pax -z -r -f /path/to/staging.cpgz

--Rich P.







More information about the Discuss mailing list