Need help preserving permissions when using tar?

Ron Flax ron at men1.UUCP
Tue Jul 2 12:33:28 AEST 1985


Does anyone know of a way to preserve file and directory permissions
and ownerships when using tar?

When I archive the files I have umask set at 0, and say I tar a directory
or two.  When I go to restore these directories/files, the files seem to 
be in tact but the directories are of course 0777.  If I use a umask of 
say 0022 then the directory is set at 0755 as is expected with that umask
setting, but the files are then also masked accordingly.

I guess what I want is to have my cake and eat it too? Is this possible?

The reason this comes up is that I just spent the better part of today, 
tar'ing my old small disk to turn around and restore everything to a new
larger disk, well I had to fix every G*d Damned directory by hand!


--
Ron at men1	(Ron Flax)
MTACCS Engineering Network
..!{seismo,prometheus,prcrs,cal-unix}!men1!ron



More information about the Comp.unix.wizards mailing list