Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!munnari.oz.au!basser!metro!natmlab.dap.csiro.au!ditsyda!evans From: evans@ditsyda.oz (Bruce Evans) Newsgroups: comp.os.minix Subject: Re: Copying and preserving file info Keywords: cpio uid mtime Message-ID: <2357@ditsyda.oz> Date: 14 Dec 89 17:44:47 GMT References: <338@trux.UUCP> Reply-To: evans@ditsyda.oz.au (Bruce Evans) Organization: CSIRO DIT Sydney, Australia Lines: 32 In article <338@trux.UUCP> car@trux.UUCP (Chris Rende) writes: >How do I copy dir's and files (to my HD) while preserving the UID, accesses, >mod time, etc...? > >cp won't do it, cpdir won't do it, tar won't do it, etc... "cpdir -ms" will do it when run by root. Any decent tar will do it when run by root. I think that includes the version recently posted by Klamer Schutte. I use this little program: #! /bin/sh # Contents: tarcp # Wrapped by evans@ditsyda on Fri Dec 15 04:42:16 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'tarcp' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'tarcp'\" else echo shar: Extracting \"'tarcp'\" \(52 characters\) sed "s/^X//" >'tarcp' <<'END_OF_FILE' Xtarg=$1 Xshift Xtar cf - $* | ( cd $targ; tar xvvf -) END_OF_FILE if test 52 -ne `wc -c <'tarcp'`; then echo shar: \"'tarcp'\" unpacked with wrong size! fi # end of 'tarcp' fi echo shar: End of shell archive. exit 0 -- Bruce Evans evans@ditsyda.oz.au