> -----Original Message-----
> From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On 
> Behalf Of Romanowski, John (OFT)
> Sent: Tuesday, October 16, 2007 11:43 AM
> To: [email protected]
> Subject: zip/unzip preserve uid/gid?
> 
> 
> As userid root I'm using zip and unzip to copy and restore a directory
> of files not owned by root (they're owner/group is oracle/oinstall).
> 
> I find the unzip-ed files and directories are all owned by root/root
> instead of oracle/oinstall as I expected.
>  Am I expecting too much?
> Maybe should use gzip/gunzip instead?  
> 
> John Romanowski

zip does not store the originating user's UID or GID in the zip file.
Neither does gzip. Use tar with the appropriate switches.

tar --create --gzip --file output.tar.gz --verbose input.file(s)

tar -p xzf output.tar.gz

The -p preserves the permissions upon extraction. It can only be used by
"root" or when you use sudo.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to