View Full Version : Question about tar -r
Titanium Man
01-30-2002, 12:09 AM
Hi all, I know there's a question about tar in the newbies section, but I felt this one was different enough to warrant it's own thread. I've been wanting to tar various folders for backup reasons, and since I add to these folders every day, I thought it would be nice to just ADD TO the tarred items rather than retarring the whole file (amazing the new words I've been inventing lately). I noticed the -r option in the man page on tar. So I've been trying to use it, but I get an error message saying
Options `-Aru' are incompatible with `-f -'
Try `tar --help' for more information.
By the way, what I've tried so far has been this:
tar alreadytarredarchive.tar newstufftoadd.tar
Anyone have any suggestions for adding to tarred archives? While we're on the subject, is it true that tarring can mess up the forks? Am I better off just using Stuffit or something?
Thanks,
TM
mervTormel
01-30-2002, 12:52 AM
Timan,
The tar command's legacy is writing archive data to magtape, usually 9-track.
Tar = tape archive
Now, which tar are we talking about?
/usr/bin/tar = OSX BSD tar
Or
/sw/bin/tar = fink's GNU tar
I don't think either tar has a switch to handle the resource forks.
Are you trying to do an incremental tar? i.e., archive only files that have been changed since the last tar? then you have to provision a way to update the file's backup timestamp.
Fink's tar lists an append switch -r, and a concatenate switch -A, which may be incompatible switches.
And one of those switches, -r I think, may only apply to magtape.
you might want to scrap this approach because of lack of support for resource forks.
it's retar'ded
Titanium Man
01-30-2002, 01:03 AM
reTARded huh? Glad to see I'm not the only one making up new words :D Thanks for the speedy reply and the help!
mervTormel
01-30-2002, 01:13 AM
Timan,
I've been using Mike Bombich's ditto clone OSX script, with great success.
http://www.bombich.com/mactips/image.html
But he's getting close to what we really want, and that is full backup plus incremental backups to rotating media, a la grandfather, father, son.
http://www.bombich.com/software/foresight.html
Something about applescript support missing for this nugget, which we should all holler at apple about making a top priority, if it isn't already.
I hope we can selectively designate files to skip, like the swapfile.
OpenVMS (a great OS) has a sweet metadata bit called the noBackup flag, and you could tag files/directories, like caches and scratch, to be skipped.
Titanium Man
01-30-2002, 01:46 AM
Hello MT, thanks AGAIN! That foresight script looks very interesting, can't wait for it to come out. I got Carbon Copy Cloner the other night but haven't tried it out. You're a font of good info, thanks!
P.S. While we're on the subject, do the other Unix archiving tools (zip, gzip, bzip2) preserve the resource forks? I just tried out TarDropper and it works great, but sometimes bzip2 can squeeze things even smaller than tar (although I believe bzip2 only works on files, not directories).
pmccann
01-30-2002, 02:55 AM
HI,
I didn't notice this thread before replying in the newbies section: you might want to have a look at my post there for utilities that copy all the mac specific data, and not just the data forks. [[/Developer/Tools, if you've got it installed, also has a few such things available, but they're pretty woefully documented.]]
Cheers,
Paul
mervTormel
01-30-2002, 03:14 AM
thanks pmccann,
how about that! we don't check our own board for tips. hmmm, some lightbulbs just broke in my back alley...
Titanium Man
01-30-2002, 10:59 PM
Wow, that looks like just what I've been looking for, thanks!!
I tried "psync" and it works great.
Thanks for the tip pmccann !
Cheers...
erombalski
07-21-2006, 07:56 PM
maybe...
tar -rvf name_of_tar_file name_of_file_to_add
Don't invoke tar with a compression program when you create the original or try to update it because it doesn't work: (tar: Cannot update compressed archives).
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.