home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / shell / 3646 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  1.8 KB

  1. Path: sparky!uunet!bcstec!kan9691
  2. From: kan9691@bcstec.ca.boeing.com (Ken Niedermeyer)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: Keeping mods AND owners of copied files
  5. Message-ID: <3450@bcstec.ca.boeing.com>
  6. Date: 26 Aug 92 16:41:06 GMT
  7. References: <3436@bcstec.ca.boeing.com>
  8. Organization: Drawing Data Management Systems
  9. Lines: 37
  10. X-Newsreader: Tin 1.1 PL4
  11.  
  12. Thanks to everyone who emailed solutions AND examples!!!
  13. Here is what I found out:
  14.  
  15. cpio will copy directory hierarchies preserving mods and owners:
  16.  
  17.         create the directory to be copied to (newdirectoryname)    
  18.     cd to the directory to be copied from
  19.         find . -depth -print | cpio -pdlm newdirectoryname
  20.  
  21. tar will copy directory hierarchies (without going to tape first)
  22.     preserving mods and owners:
  23.  
  24.     create the directory to be copied to (newdirectoryname)
  25.     cd to the directory to be copied from
  26.     tar cf - . | (cd newdirectoryname; tar xpfB -)
  27.  
  28. NOTE: for both of the above the following applies-
  29. Under BSD-like unixes, you must be root to assign someone else's uid
  30. to a file.  Under SysV you will run into a different problem: when you
  31. create a directory and then change its ownership to someone else, you
  32. might no longer have write permissions.  Hence, you can't create any
  33. files in it. (Thanks Michael)             
  34.  
  35. Again thanks to everyone who sent mail about this problem!
  36.  
  37. ---
  38. Ken Niedermeyer            | The views expressed above do not represent
  39. Computing Systems Analyst    | those of my employer.... (but when do they?)
  40. Boeing Computer Services (BCS)  | 
  41.                                 | NOTICE:
  42. Internet:                       | Lack of planning on your part
  43. kan9691@eeidf002.ca.boeing.com  | does not constitute an emergency on my part.
  44.  
  45. -- 
  46. Ken Niedermeyer            | NOTICE:
  47. Computing Systems Analyst    | Lack of planning on your part
  48. kan9691@eeidf002.ca.boeing.com    | does not constitute an emergency on my part.
  49.