UNIX backup tools on OSX

Just make a tarball with some excluded files

The 10.4+ versions of OSX include a tar command that handles resource forks. Older versions won't preserve any resource forks if you use this method.

First make a list of files you don't want to include (note that the first command with > creates file, following commands with >> add to it:

find ~/Music > ~/backup.exclude
find ~/Pictures >> ~/backup.exclude
find ~/.Trash >> ~/backup.exclude

Make tarball:

tar -zcf /tmp/mac-home-$LOGNAME.tgz --exclude-from ~/backup.exclude ~ 


tar -ztf /tmp/mac-home-$LOGNAME.tgz | wc
find ~ | wc
wc ~/backup.exclude

Then copy it someplace secure:

scp /tmp/mac-home-$LOGNAME.tgz <somewhere>:


  • this is arranged so that the Users/ is included in the paths in the tarball
  • you need free space on /tmp to write the tarball
  • you may prefer to just empty Trash instead of excluding it, or you may wish to backup your Trash (in ~/.Trash)...
  • the directory ~/Library/Printers has a lot of little files, you may wish to exclude it as well

Using rsync

to add... -- TomRockwell - 30 May 2006
Topic revision: r1 - 30 May 2006, TomRockwell
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback