A script to create multi-DVD-spanning backups

May 24, '07 07:30:00AM

Contributed by: harrisj

This hint is based on this previous hint, and alluded to in this comment to that hint. I went ahead and created a DVD-spanning script using tar. Copy and paste this code into your favorite pure text editor, and save it as tar2dvd.sh. In Terminal, make it executable (chmod 755 tar2dvd.sh), and store it somewhere on your path for easy access.

To use it, just type tar2dvd.sh folder_to_backup in Terminal. For example, you could do this:

$ cd ~/Documents
$ tar2dvd.sh MyBigFolder
When the processing is done, you'll find a new folder called MyBigFolder.backup, which will contain numbered subdirectories, one per DVD.

[robg adds: This worked well in my testing, even on folders with spaces in their names. Note that if you use Apple's Backup app, you'll probably want to change the line that reads TARDIR=$BACKUPDIR.backup -- the .backup extension will make it appear as though the end result is a Backup package bundle. I changed the extension to simply .bkup, and then the end result is a folder, as expected.]

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070519051857216