home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / shell / 3652 < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.2 KB  |  35 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!news
  3. From: Harald.Eikrem@delab.sintef.no
  4. Subject: Re: Keeping mods AND owners of copied files
  5. In-Reply-To: kan9691@bcstec.ca.boeing.com's message of 26 Aug 92 16:41:06 GMT
  6. Message-ID: <1992Aug27.022126*Harald.Eikrem@delab.sintef.no>
  7. Sender: news@ugle.unit.no (NetNews Administrator)
  8. Organization: SINTEF DELAB, Trondheim, Norway.
  9. References: <3436@bcstec.ca.boeing.com> <3450@bcstec.ca.boeing.com>
  10. Date: 27 Aug 92 02:21:26
  11. Lines: 22
  12.  
  13. kan9691@bcstec.ca.boeing.com (Ken Niedermeyer) reported:
  14.  
  15. ! Thanks to everyone who emailed solutions AND examples!!!
  16. ! Here is what I found out:
  17. ! cpio will copy directory hierarchies preserving mods and owners:
  18. !         create the directory to be copied to (newdirectoryname)    
  19. !     cd to the directory to be copied from
  20. !         find . -depth -print | cpio -pdlm newdirectoryname
  21. ! tar will copy directory hierarchies (without going to tape first)
  22. !     preserving mods and owners:
  23. !     create the directory to be copied to (newdirectoryname)
  24. !     cd to the directory to be copied from
  25. !     tar cf - . | (cd newdirectoryname; tar xpfB -)
  26.  
  27. Also check out GNU `cp -a' if you can, latest version found in
  28. fileutils-3.3, I believe.
  29.  
  30.   ~~harald E.
  31.