Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rate Thread Display Modes
Old 01-29-2002, 06:54 PM   #1
Digger
Prospect
 
Join Date: Jan 2002
Location: Tucson, AZ
Posts: 8
backups using tar

Has anyone used tar to backup files? Is this a good way to avoid buying a backup program. What about compressing and uncompressing files? Thanks.
Digger is offline   Reply With Quote
Old 01-29-2002, 07:52 PM   #2
wayneyoung
Triple-A Player
 
Join Date: Jan 2002
Location: Colorado Springs, CO
Posts: 216
Post Using tar to backup

tar with the z option to compress the backup works fine. Be warned though, if any of your files have resource forks that info will be lost and the file will be useless once restored. You probably use programs in OSX that create files with resource forks, so be careful. Probably the best way to test it is make a copy (I say a copy because I'm paranoid)of the file(s) in question, put them in a temp directory and tar and compress. Then restore them and see if they still work.
wayneyoung is offline   Reply With Quote
Old 01-29-2002, 08:52 PM   #3
level9
Prospect
 
Join Date: Jan 2002
Posts: 34
I don't know if this helps, but you can stuff and unstuff from the command line, that's what I do.

These lines are in my .tcshrc:

stuff (open -a /Users/path/to/DropStuff)
unstuff (open -a /Users/path/to/Expander.app)
level9 is offline   Reply With Quote
Old 01-30-2002, 01:41 AM   #4
pmccann
Major Leaguer
 
Join Date: Jan 2002
Location: Adelaide, South Australia
Posts: 470
Some backup options

Hi,

A few other options, which do take resource forks into account.

hfstar, which I haven't used:

http://www.geocities.com/paulotex/tar/

hfspax, which I've used very successfully:

http://homepage.mac.com/howardoakley/

There's also a perl based new kid on the block from Dan Kogai, called "psync" (obviously nodding at rsync, though it's a little feature-poor compared to the all-singing all-dancing rsync. It does however have the great virtue of copying both resource forks and Finder bits, and can create a bootable mirror of a disk). It's a very nice simple way to create and maintain a mirror: it only copies changed folders unless forced to do otherwise, and also has the option of deleting files on the backup copy that no longer exist on the "live" version of your data.

Anyway, the way to get psync is via the Perl module "MacOSXFiles". **It requires you to have installed the 10.1 Developer Tools, since it's really hooking into a lot of the functionality that they provide, but in a more helpful form**. The module is currently at version 0.61, and can be found at

http://search.cpan.org/search?dist=MacOSX-File

Download the .tar.gz file (but *don't* trust stuffit to open it; just trash the .tar and the folder it creates if stuffit have got hold of the file!!). Open a terminal window, go to the directory where the downloaded file sits and enter:

% tar zxf MacOSX-File-0.61.tar.gz
% cd MacOSX-File-0.61/
% perl Makefile.PL
% make

(this will take about twenty seconds or so, and output some lovely compilation muck to your window)

% make test

(and if all goes well, as per the screen output:
All tests successful.
Files=5, Tests=29, 2 wallclock secs ( 1.15 cusr + 0.32 csys = 1.47 CPU) you should then enter)

% sudo make install
password:.....

Done. You should now be able to read the psync man page for the lowdown on how to use it. Quite straightforward. You probably need to enter "rehash" in the terminal window so that the shell knows about the location of the "psync" executable. Here's one example of how it can be used:

% sudo psync -d /Users/pmccann /Volumes/backupdisk/backup

would produce a copy of my home directory (and all subdirectories of course) inside the backup directory on "backupdisk". Subsequent invocations of the same command will sync the backup with the active copy, deleting files on the backup that have been deleted on the main copy (if you don't want this to happen just take out the "-d" flag), and only copying files that have changed. Give it a try on some non-critical directory until you trust that it's working! You can obviously do a full backup by setting the source directory to "/". The backup version thus gained is claimed to be bootable, and I fully believe that it will be, but I haven't yet tried that out.
[[Note the -r flag in the manual pages if you are going to be trying this out, particularly to a volume mounted using samba or nfs or ...]]

Cheers,
Paul (who takes even less responsibility than the author of the package for any misbehaviour!)
pmccann is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:11 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.