home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!bcstec!kan9691
- From: kan9691@bcstec.ca.boeing.com (Ken Niedermeyer)
- Newsgroups: comp.unix.shell
- Subject: Re: Keeping mods AND owners of copied files
- Message-ID: <3450@bcstec.ca.boeing.com>
- Date: 26 Aug 92 16:41:06 GMT
- References: <3436@bcstec.ca.boeing.com>
- Organization: Drawing Data Management Systems
- Lines: 37
- X-Newsreader: Tin 1.1 PL4
-
- Thanks to everyone who emailed solutions AND examples!!!
- Here is what I found out:
-
- cpio will copy directory hierarchies preserving mods and owners:
-
- create the directory to be copied to (newdirectoryname)
- cd to the directory to be copied from
- find . -depth -print | cpio -pdlm newdirectoryname
-
- tar will copy directory hierarchies (without going to tape first)
- preserving mods and owners:
-
- create the directory to be copied to (newdirectoryname)
- cd to the directory to be copied from
- tar cf - . | (cd newdirectoryname; tar xpfB -)
-
- NOTE: for both of the above the following applies-
- Under BSD-like unixes, you must be root to assign someone else's uid
- to a file. Under SysV you will run into a different problem: when you
- create a directory and then change its ownership to someone else, you
- might no longer have write permissions. Hence, you can't create any
- files in it. (Thanks Michael)
-
- Again thanks to everyone who sent mail about this problem!
-
- ---
- Ken Niedermeyer | The views expressed above do not represent
- Computing Systems Analyst | those of my employer.... (but when do they?)
- Boeing Computer Services (BCS) |
- | NOTICE:
- Internet: | Lack of planning on your part
- kan9691@eeidf002.ca.boeing.com | does not constitute an emergency on my part.
-
- --
- Ken Niedermeyer | NOTICE:
- Computing Systems Analyst | Lack of planning on your part
- kan9691@eeidf002.ca.boeing.com | does not constitute an emergency on my part.
-