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

Multi-DVD or (multi-CD) spanning backups with tar UNIX
I have never done a backup despite having had my iMac G5 for about 7 months. One of the reasons for this is I do not have an external disk. I realised I could backup to DVDs but have been put off by the hassle of organising my data in such a way that it fits into neat amounts that each fill a DVD. Of course I'm sure there are plenty of great software applications I could buy that would make things easier, but it occurred to me that since MacOS X is UNIX based I probably have all the tools I need to do a backup (or I could at least get them for free).

After a bit of thinking, I figured tar was probably the best option, since it allows for multi-part backups with the -M switch. Though I soon realised (after a few web searches) that the versions of tar included with Panther (my current OS) do not understand resource forks, and this could potentially cause me problems further down the line, should I need to restore (Tiger's tar does support resource forks).

A bit more searching on the web and I stumbled across hfstar and xtar, which are both variants of GNU tar, but do support resource forks (although they store the resource forks inside the tar in different ways, and are hence incompatible). In terms of features, there is nothing to choose between them; they do exactly the same thing. There was mention on one website that author of the page had encountered some errors with hfstar and switched to xtar (which fixed the issue). To be fair though this could be related to old problems that have since been fixed. Also there seems to be a greater number of people recommending hfstar than there are xtar (though this could be related to the fact that it seems to be older). I recommend you test both and see which works for you. I decided to go with xtar first but might try hfstar next time.

Anyway, below I have outlined the method I used to do the multi-DVD backup (it would also work with CDs). Feel free to change the instructions to make use of hfstar instead if you prefer. Or if you are a Tiger user, you can simply use the tar program provided. I would not advise using one version of a resource fork capable tar (hfstar, xtar, or Tiger tar) to back up and another one to restore. My understanding is that they all support resource forks in incompatible ways, so whatever you use to back up, you should also use to restore!

Here is the method:
  1. Close all applications (to prevent files being altered during backup).
  2. Place a blank DVD-R in the drive, and when you get the pop-up to name it, give it a suitable name e.g. "multipartdvdbackup".
  3. Start the terminal and issue the following commands:
    $ cd /
    $ sudo xtar -cvpMf /Volumes/multipartdvdbackup/backup.tar Users/
    
    Here is a breakdown of what the switches mean:
    • -c create
    • -v verbose (show files as the are written)
    • -p preserve permissions
    • -M multi-volume archive
    • -f the location and name of the archive
    You may also want to backup Applications/ and Library/ as well. If so add it on after them after Users/.
  4. Once the data to fill one DVD has been written, you will be prompted by xtar to change media. At this point, control-click the DVD on the desktop (e.g. "multipartdvdbackup") and choose "Burn." This will actually write the data to the DVD (up until now, it has only been written to a DVD image).
  5. Once burning is finished eject the DVD-R, label it something like "Part 1" with a pen, and stick in the next blank DVD-R. When prompted for a name, you must give it the exact same name as the previous DVD (including the same case).
  6. Go back to the Terminal window and hit Enter to start copying the next part.
  7. Once done, repeat steps four through six (changing step five only to label each part appropriately, e.g. "Part 2", "Part 3", etc.) until all your data is backed up.
You should now have a complete backup of all data in your /Users folder and its subdirectories (and optionally your /Applications and /Library folders as well).

To restore, you would simply stick in the first DVD, fire up the Terminal, and issue the following:
$ cd /
$ sudo xtar -xvpMf /Volumes/multipartdvdbackup/backup.tar
The -x flag tells xtar to extract the files from the archive.

I didn't bother compressing the data, since I figured that the extra time delay cause by running gzip would not be worth it (to me). I'd prefer use an extra DVD-R or two and save the time. However, if you wanted, you could add the -z switch to both the creation and extraction of the backup. A better option might be to install lzop (a very high speed compressor that does not compress quite as well as gzip but is a good deal faster) via Fink or DarwinPorts and invoke it via the switch: --use-compress-program=lzop.
    •    
  • Currently 2.80 / 5
  You rated: 2 / 5 (5 votes cast)
 
[40,169 views]  

Multi-DVD or (multi-CD) spanning backups with tar | 39 comments | Create New Account
Click here to return to the 'Multi-DVD or (multi-CD) spanning backups with tar' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: raider on Jun 23, '05 01:00:30PM
I prefer to use DropDMG. It is a great program, and priced affordably for what you get! I have been using it since it's first release. The developer has been very responsive to fixes and enhancements...

obDisclaimer:(I have no connection other than that I am a beta tester for DropDMG. I have nothing to gain by pushing the software, and I have never even met the developer other than via email).

[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: dav on Jun 23, '05 01:40:46PM

I learned that panther's tar did not have resource forks the hard way :-(

So if I use just plain old tar to backup on tiger than I should be good to go?



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: Gigacorpse on Jun 23, '05 02:54:09PM

As someone who dislikes resource forks, I would say that is a feature, not a bug. ;)



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: ruaric on Jul 12, '05 06:22:52AM

Yes, as others in the thread have confirmed Tiger's tar does support resource forks.



[ Reply to This | # ]
You might need to use xtar on Tiger as well
Authored by: ruaric on Aug 20, '06 07:07:35AM

It would seem that the version of tar supplied with Tiger may not support long filenames (over 100 characters) since it is now based on BSD tar rather than GNU tar. I would therefore use xtar. Whatever you do though, make sure you test.



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: Gigacorpse on Jun 23, '05 03:02:20PM

I have thought about creating tar archives and putting them on CD put I worry that a simply bit error someone on the CD would keep me from recovering the entire archive.

(Because of this fear, I copy individual files and directories to disk images, using Ditto, and burn those. Of course, the downside of this approach is that I have to predetermine what size to make the disk images so that I can split my data up for burning to CD.)

Is there anything like recovery parity for archive files?



[ Reply to This | # ]
fink's gnutar
Authored by: englabenny on Jun 23, '05 03:56:01PM

Fink installs tar and gzip in version inferior to the Apple-supplied ones, and refuses to uninstall those. The fink tar won't preserve those resource forks.

What can one do to make /usr/bin/tar and /usr/bin/gzip the preferred commands? I'd like a clean solution that applies to all interactive and non-interactive shells and processes, but fink doesn't seem to cooperate.



[ Reply to This | # ]
fink's gnutar
Authored by: jtratcliff on Jun 23, '05 04:14:20PM

Either us the full path or just make sure that /usr/bin comes before /sw/bin in your PATH environment variable... which means changing /sw/bin/init.csh to use "append_path" instead of "prepend_path"... I don't know if the change will stick after your next "fink selfupdate" though.

Note: I have not tried this...



[ Reply to This | # ]
fink's gnutar
Authored by: metafeather on Jun 24, '05 02:00:13PM

I'm not sure is this is still the case as the versions on my system (clean install of 10.4.1 are the same):


$ fink --version
Package manager version: 0.23.10
Distribution version: 0.8.0
Copyright (c) 2001 Christoph Pfisterer
Copyright (c) 2001-2005 The Fink Package Manager Team

$ which tar
/sw/bin/tar

$ls -l /sw/bin/tar 
lrwxr-xr-x   1 root  admin  4 Jun 14 17:40 /sw/bin/tar -> gtar

$ /sw/bin/gtar --version
tar (GNU tar) 1.14
Copyright (C) 2004 Free Software Foundation, Inc.

$ ls -l /usr/bin/tar 
-rwxr-xr-x   2 root  wheel  186024 Mar 21 22:53 /usr/bin/tar

$ /usr/bin/tar --version
tar (GNU tar) 1.14
Copyright (C) 2004 Free Software Foundation, Inc.


[ Reply to This | # ]
fink's gnutar
Authored by: metafeather on Jun 24, '05 02:04:41PM

Oops gzip *is* different:


$ /sw/bin/gzip --version
gzip 1.2.4 (18 Aug 93)
$/usr/bin/gzip --version
gzip 1.3.5
(2002-09-30)


[ Reply to This | # ]
fink's gnutar
Authored by: ash7 on Jul 06, '05 02:20:37AM
You left out some critical information....
$ /usr/bin/tar --version
tar (GNU tar) 1.14
Copyright (C) 2004 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
Modified to support extended attributes.

$ /sw/bin/gtar --version
tar (GNU tar) 1.14
Copyright (C) 2004 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
They are very different...

[ Reply to This | # ]
fink's gnutar
Authored by: stcanard on Jun 24, '05 03:56:15PM

Boy you scared me there, I just did a "which tar" and realized that it is pointing at /sw/usr/bin/tar

So I went to check my backup script to see if I have been losing the resource forks all along, and discovered that I had explicitly used '/usr/bin/tar'

I guess good scripting habits do pay off :)



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: payrolldude on Jun 23, '05 04:10:17PM

Any clues on how to do self extracting encrypted archives for Windows? I need to send sensitive data (I am a bookkeeper) to clients who have not seen the light. Even if they are not self extracting, that is okay, as long as they are encrypted. Thanks all.



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: PopMcGee on Jun 23, '05 04:33:27PM

.Zip files can be encrypted (needs third party tools), as can pdf (included in Tiger with the help of automator). Both are cross-platform.



[ Reply to This | # ]
Windows file encryption
Authored by: victory on Jun 24, '05 01:55:28AM

At one time the Windows version of PGP could create self-decrypting archives. (Likewise the Mac version of PGP created mac executables) Seemed like a good idea for sending sensitive content to recipient without the PGP package installed -- except that a lot of people (and corporate email servers) are now highly suspicious about .exe (executable) attachments. I haven't kept track of PGP so I don't know how current (or relevant) it is any more.

As to encrypted ZIP files, the problem is that there are several variants of this format and using the wrong options could create a false sense of security in a weakly protected file. In particular, the classic 'encryption' feature used in the original PKZip products isn't considered cryptographically secure in the least. (It's more akin to the casual password-protection of documents that word processors offer) There are at least two competing Windows products that offer AES encrypted zip files, but there is some question as to how standard the format is.

One final note: So far the only cross-platform, somewhat legacy-proof, albeit cumbersome method of encrypting flat files I've come across is the openssl cmd-line utility. (See http://www.openssl.org/docs/apps/enc.html )



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: qwerty denzel on Jun 24, '05 02:13:08AM

Stuffit Deluxe? http://www.stuffit.com/mac/deluxe/index.html



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: cabbagewater on Jun 24, '05 10:50:08AM
This method, as far as I can tell, will NOT work with Tiger, because it handles the burning of optical media differently. That is, the Finder in Tiger does not create a disk image to burn to a CD or DVD. Instead, a directory with extension .fpbf is created, and when you drag items into that directory, aliases are created there. This is a very good thing for people with tight hard drive space, as you no longer need 700MB of free space to burn a CD, or 4.7GB of free space to burn a DVD. However, the blank CD is not "available" at
/Volumes/<cd name>
You can browse to it at
~/Desktop/<cd name>.fpbf
I tried substituting that for the path listed in the hint. This works, except that since you're working with a directory instead of a disk image, there is no space restriction, other than the available space on your hard drive. Thus, the multi-volume part of this hint doesn't work in Tiger.

[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: rflo on Jun 24, '05 11:41:03AM

Would it work on 10.4 to create a blank DVD-sized disk image, name it backup-050624 then run tar with /Volumes/backup-050624 as the -f option? When tar asks for a new tape, the disk image could be burned, you create a new blank disk image with the same size and name, and tar continues? Unfortunately, creating DVD-sized blank disk images is slow.


---
Ronald Florence



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: ruaric on Jun 24, '05 01:12:25PM
Interesting! However I think there is a way around this. GNU tar, which both xtar and hfstar are based on include an -L switch which allows you to limit the size of the archive. From the help page:
-L, --tape-length=NUM
This prompts to change tape after writing NUM x 1024 bytes. Unfortunately, I don't believe that Tiger tar includes this so even Tiger users would need to continue to use xtar or hfstar.

One other thing I notice though is that using Tiger the archive would now be created in a subdirectory of a directory that is being tarred (~/Desktop/.fpbf is within /Users). This would surely cause a problem since the tar archive would include itself.

Of course if you are just backing up your 'own' user folder (for example in my case that would be /Users/ruari) you could still do it quite simply. Just switch to different user and run the commands as:


$ cd /
$ sudo xtar --tape-length=4900000 -cvpMf /Users/<differentusername>/Desktop/<cd name>.fpbf Users/<regularusername>/
This would create each part as a 4.67GB file (I think DVDs hold ~=4.7GB, so I made this a bit smaller just to be sure, but you could adjust this figure to suit you). Everything else would be the same as my old instructions for Panther. ;-)

If you did want to grab the whole /User folder this 'might' work:


$ cd /
$ sudo xtar --tape-length=4900000 --exclude=/Users/<username>/Desktop/<cd name>.fpbf -cvpMf /Users/<username>/Desktop/<cd name>.fpbf Users/
(Alternatively, the -X switch allows you to specify a file containing a list of excludes).

If for some reason this didn't work here is another way:


$ cd /
$ mkdir /tmp/multipartdvdbackup/
$ sudo xtar --tape-length=4900000 -cvpMf /tmp/multipartdvdbackup/backup.tar Users/
When prompted for the next DVD open a new terminal window and type:

$ open /tmp

Then use the burn folders thing in Tiger to burn the "multipartdvdbackup" folder. After this is done delete backup.tar and then hit enter in the original terminal window to start making part two (and so on).

Yes the last one is a bit more messy but I think it should work (I don't have Tiger to try it out!)

(If you aren't backing up whole user folders but just want to span a few files across multiple DVDs there should be no problems with taring the tar file).

[ Reply to This | # ]

Multi-DVD or (multi-CD) spanning backups with tar
Authored by: rflo on Jun 24, '05 04:02:41PM
Tiger tar, which is based on gnutar, does include the -L n option. I think n should be 4550000 for a DVD. (File size = n * 1024.) I slapped together a little shell script to set up the backup file names (and to remember the whole sequence for me with an echo reminder).

#!/bin/sh

day=`date "+%y%m%d"`
file= /tmp/backup-$day
cd /

echo "When tar asks for a new volume, use the burn folder feature in the Finder, 
then erase $file/backup.tar before hitting return to restart tar."

mkdir $file
sudo tar -L 4550000 -cvpMzf $file/backup.tar Users usr/local

It should be possible to code some applescript to burn the folders. I'll leave that exercise for whoever has the time.

---
Ronald Florence

[ Reply to This | # ]

Multi-DVD or (multi-CD) spanning backups with tar
Authored by: GlowingApple on Mar 14, '06 08:59:58AM

Technically I believe you would convert 4.7 GB to MB and then convert MB to KB:

4.7 * 1024 * 1024 = 4,928,307 KB

So 4928307 is the supposed max for a DVD (though usually DVD-R and DVD+R can hold a little more, so you could probably round up a bit or to be safe (allow space for the session open and close data, etc), round down a bit).

---
Jayson --When Microsoft asks you, "Where do you want to go today?" tell them "Apple."



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: tinker on Jun 27, '05 12:51:48PM
Interesting hint!! One question: Could this --
$ cd /
$ sudo xtar --tape-length=4900000 -cvpMf /Users/<differentusername>/Desktop/<cd name>.fpbf Users/<regularusername>/
-- be modified in order to get it to produce a set of one-DVD-sized tarballs in /Users//Archive/, say? That way, I could have it create the tar archives via cron while I sleep every week, and then just burn the DVDs, saving a fair bit of time in the process.

[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: ruaric on Jun 29, '05 09:04:05AM

Yes, use -F or --info-script=FILE

This allows you to run a script at end of each tape. That way you could write to a tar file of a set size, when the first part is done you could have a script move that part to a subfolder called part1, when the next part is done it could move it to a subfolder called part2 (it could know to increase the folder number because the folder part1 already exists), and so on.

At the end you would have several folders each with a single part in them. The reason for putting them in subfolders is of course the fact that they all have the same file name.

I'll leave you to work out a suitable script! ;-)



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: E5o on Jun 24, '05 02:44:31PM
Indeed, I never did trust either of the "tars". I would like to just chime in with a tool with which I have had a successful relationship for over two years now. It's hfspax, a modified version of the standard pax-utility to take on resource-forks properly. To make a multipart backupfile you coud say something like this:
hfspax -wvf /Volumes/<your_backup_destination>/backupfile -x cpio -B 4500M /backupdirectory
-w
=write out mode
-v
=verbose mode
-f
=specifying the backupfile, because OSX does not support tape
-x
=write the files in cpio-format. You can also choose from other formats, it' just my own preference And now for the important part
-B
=specifies the backupfile size. You can choose: M(egabytes), K(ilobyes) When your backupfile reaches 4500Megabytes, you're prompted to give the new file a name. You must give it the same path as the first file, give it a logic name: First file : /Volumes//backupfile_1 Second file : /Volumes//backupfile_2 You get the idea. To restore: use
cat backupfile_1 backupfile_2 > new_file
then:
hfspax -rvf <new_file> -pe -k 
This will restore it all back to its former glory, resourceforks and all. New this time is:
-r
=read in mode
-pe
="preserve everything" - file permissions, mod.times, etc
-k
=Normally hfspax overwrites everything in its way, this option make hfspax not overwrite existing files. There are tons of other useful options, so go explore. Cheers E5o

[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: ruaric on Jul 12, '05 06:32:02AM

Interesting. Rather than combining the parts back together prior to the restore can hfspax prompt for each new part in the way that tar does? I wouldn't have the space to copy all the parts to my hard disk and cat them together prior to extraction.



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: E5o on Jul 12, '05 03:55:56PM
I think so, yes. hfspax will prompt you for the new filename when appropriate. Remember to type in the complete path, not just the filename, when hfspax ask your for the next filename. e.g. filename:
 my_backupfile
full path:
/Users/your_home/my_backupfile
or whatever place you prefer, obviously. Cheers E5o

[ Reply to This | # ]
Resource forks do not appear to be restored with hfspax under Panther.
Authored by: ruaric on Aug 20, '06 06:02:41AM

Running the latest available version of hfspax (hfspax1fc4.tar.gz) under Panther 10.3.9 I have had no luck retaining resource forks. I can see that hfspax attempts to back them up but on restore they are missing. I'll stick with xtar, which has not resulted in any problems.



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: stcanard on Jun 24, '05 03:52:22PM
Be careful using hfstar for this!

I was using hfstar to do backups because I wanted to preserve the resource forks. When I actually had a disk failure, I discovered that hfstar was unable to untar my larger (7GB) backup files!

Fortunately the regular Panther tar was able to open them, but I lost any of the resource forks anyway.

So if you're going to use this system, make sure you test untarring real files as well. You don't want to end up with backups you can't use!

[ Reply to This | # ]

Multi-DVD or (multi-CD) spanning backups with tar
Authored by: ruaric on Jul 12, '05 06:27:18AM

Interesting, on the backups I have done with xtar I have not encountered problems (and I have backed up far more than 7GB). Based on your experience and what I have read elsewhere I think that xtar is probably a safer option than hfstar.



[ Reply to This | # ]
Multi-DVD or (multi-CD) spanning backups with tar
Authored by: JimAkin on Jun 25, '05 12:15:31PM

I've had very good luck with Stefan H├╝lswitt's free CDBackup.

Despite its name, it works with DVD-R(W) and CD-R(W)s.

It uses hfspax (included in the installation) and gzip for multi-disc backups. It also does full and incremental backups, with the caveat that file deletions aren't tracked for incremental backups. (Files you delete between backups show up again when you do a restore.)

---
Jim

[ Reply to This | # ]

Multi-DVD or (multi-CD) spanning backups with tar
Authored by: braver on Nov 28, '06 10:39:02PM

Checked the link -- seems for Linux. It also directly writes to a device such as /dev/scd0 on Linux. Did you have to patch it for Mac OS, and does it write to a burner directly -- how do you know which one?



[ Reply to This | # ]
bah. use rsync.
Authored by: Lectrick on Jun 27, '05 05:05:10PM
I have too much stuff to even back up to DVD (nor do I have time to sit there babysitting a backup and swapping DVD's), so I have to use a second drive. Here's my one-liner backup, either run manually or scheduled in Cron with Cronnix in the system crontab (in the latter case you have to remove the "sudo" as it runs in admin mode anyway):

sudo /usr/bin/rsync -a --delete --partial --exclude "/.*" --exclude "/dev/*" --exclude "/Desktop*" --exclude "/*Volume*" --exclude "/Network*" / /Volumes/Backup/

(Replace "/" and "/Volumes/Backup/" with the path you want to back up from, and the path you want to back up to. In my case, these are two drives.)

I know it works because I recently had a major directory corruption issue that required me to reformat the disc. I only lost 2 days' worth of stuff since I was able to boot right off the backup drive using this method, and then copy the contents back to my main drive.

If you are running this from the command line manually and want to see progress indication, put a "v" after the "-a" for "verbose" and also add the "--progress" switch. Watch it fly.

I suggest a twice-a-week backup schedule. If you want to get more sophisticated you can set up a nightly and a weekly to two different drives/locations. Both have advantages (mainly revolving around discovering a mistake after your only backup already occurred, preventing you from restoring to a state previous to the mistake)

Advantages of using rsync for this:

1) Only copies changed files, and even only changed parts of larger files
2) If you later move to an offsite backup, a minor change to the rsync parameters will give you an encrypted, compressed transfer of just your changed information, to anywhere on the Internet (even another non-Microsoft OS!)
3) Uses Apple's Tiger implementation of rsync, so resource forks are preserved. (note: you can't use this method in Panther- I suggest psync or Carbon Copy Cloner for that) 4) Creates a live bootable drive. I was back up and running in 5 minutes in my case, even though I did lose some work.

Lastly, I STRONGLY suggest testing out ANY backup process. Consider it "disaster recovery procedures". Do NOT wait till you actually have a failure to test your backup plan!

---
In /dev/null, no one can hear you scream

[ Reply to This | # ]

bah. use rsync.
Authored by: rflo on Jun 28, '05 10:41:26AM

The problem with rsync as a backup tool under MacOS 10.4 is that without the -E option, resource forks are not backed-up. And with the -E option, the MacOS 10.4 rsync sets the file date/time to the present -- which isn't what you want on a backup.

It should be more useful when Apple fixes it, perhaps in 10.4.2.

---
Ronald Florence



[ Reply to This | # ]
Backup script for 10.4
Authored by: dougmoby on Feb 09, '06 12:05:55PM

Beware of long filenames and pathnames. The -M option works with gnu tar in OS X 10.4 as long as all filenames (including path) are fewer than 100 characters. I had major headaches over this issue when trying to archive my hard drive over multiple DVDs. The authors of gnu tar promise POSIX and Multi-volume compatibility in later versions (see http://www.gnu.org/software/tar/manual/html_chapter/tar_8.html#SEC127), but for now be very careful.



[ Reply to This | # ]
In the meantime, what about psync?
Authored by: Thom on Jun 29, '05 10:36:13AM

It was my understanding that the psyncX utils were mac resource-fork aware, and had been around for a while now.

http://sourceforge.net/projects/psyncx

It is also my understanding that Bombich's excellent Carbon Copy Cloner utility is, in some part, a front-end GUI wrapper for psync.

Here is another useful page I found:

http://www.chemistry.ucsc.edu/~wgscott/xtal/backup_hfs_stuff.html



[ Reply to This | # ]
Backup script for 10.4
Authored by: rflo on Jun 28, '05 10:28:39AM
Here's a script for multi-volume backups on MacOS 10.4. Usage is

backup [-cd] [-m yyyy-mm-dd] [files]
The default files are specified in the script and should be modified as needed, the default medium is DVD, and the default backup is from the epoch. The -cd option changes the medium to CD, and the -m option allows you to do an incremental backup from the date specified.

#!/bin/sh
# ron@18james.com, 26 Jun 2005

day=`date "+%y%m%d"`
folder=/tmp/backup-$day
files="Users/heather Users/ron usr/local/web usr/local/pgms"
length=4550000
medium="DVD"

while [ $# -gt 0 ]
  do
  case $1 in
      -m) shift; arg="--newer-mtime=$1"; shift;;
      -h) echo "usage: backup [-cd] [-m yyyy-mm-dd] [files]"; exit;;
      -cd) length=680000; medium="CD"; shift;;
      *) files="$@"; break;;
  esac
  done

echo -n "Ready to backup $files to $medium? "
while read yn
  do case $yn in
      y*|Y*)  break ;;
      n*|N*)  exit 1 ;;
      *)  echo -n "Yes or no? " ;;
  esac
  done

echo "When tar asks for a new volume, drag $folder to a burn folder
in the Finder and burn the $medium.  Then delete $folder/backup.tar
before pressing return to restart tar for the next $medium."

mkdir $folder
cd /
sudo tar -L $length $arg --exclude=Users/*/Library/Caches --exclude=Users/*/.Trash -cvpMf $folder/backup.tar $files 
To use the backup script unattended, write a short script that will move /tmp/backup-/backup.tar to an archival location with a unique filename, such as the current time. Invoke that script in the tar command with "--new-volume-script=". You may also need to run the tar command as "tar ... < `yes`". (I haven't bothered with unattended operation because the tar archiving is very quick compared to the s-l-o-w burning of DVDs.)

---
Ronald Florence

[ Reply to This | # ]

Multi-DVD or (multi-CD) spanning backups with tar
Authored by: dougmoby on Feb 09, '06 12:08:54PM

Beware of long filenames and pathnames with tar in 10.4. The -M option works with tar in OS X 10.4 as long as all filenames (including path) are fewer than 100 characters. I had major headaches over this issue when trying to archive my hard drive over multiple DVDs. The authors of gnu tar promise POSIX and Multi-volume compatibility in later versions (see http://www.gnu.org/software/tar/manual/html_chapter/tar_8.html#SEC127), but for now be very careful.



[ Reply to This | # ]
This is a problem with the BSD tar supplied with Tiger, GNU tar and xtar have no such problem
Authored by: ruaric on Aug 20, '06 05:55:21AM
You link does not work. I assume it did when you provided it but it does not now.

I believe the problem here is that in Tiger's tar is based off BSD tar. However xtar and Panther's tar are based off of GNU tar 1.13.25 (I'm not sure why Apple made the switch back to BSD for this utility).

Anyway GNU tar 1.13.25 uses the GNU tar format by default. Archives in GNU format are able to hold pathnames of unlimited length. You can find more information on the variying tar formats on the GNU website: http://www.gnu.org/software/tar/manual/html_node/Formats.html#Formats

In order to confirm the above I have just tested creating folders with very long names (well over 100 characters) and archived them with xtar. This resulted in no errors and both the long filenames and resource forks were preserved correctly. Therefore, based on your experience I would suggest that Tiger users use xtar rather than the tar supplied by Apple for imporant backups.

(Note: I would advise doing your own testing of xtar to confirm what I have stated above).

[ Reply to This | # ]
To clarify, my tests included multipart tar backups.
Authored by: ruaric on Aug 20, '06 05:58:38AM

As per the title I did also test multipart tar backups with long file names and resource forks. Again, I had no problems.



[ Reply to This | # ]