home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!news.sei.cmu.edu!drycas.club.cc.cmu.edu!pitt.edu!suthers
- Newsgroups: comp.unix.questions
- Subject: Re: Utility for keeping two directories consistent (identical)?
- Message-ID: <10015@blue.cis.pitt.edu.UUCP>
- From: suthers+@pitt.edu (Daniel D Suthers)
- Date: 21 Nov 92 17:12:00 GMT
- Sender: news+@pitt.edu
- Followup-To: suthers+@pitt.edu
- References: <9966@blue.cis.pitt.edu.UUCP>
- Organization: University of Pittsburgh
- Keywords: directory consistency
- Summary: find . -print |cpio -pmd other_directory
- Lines: 38
-
- In article <9966@blue.cis.pitt.edu.UUCP> I wrote:
- >Do you know of a utility for keeping the contents of two directories
- >consistent (identical)?
-
- Thanks much to les@chinet.chi.il.us (Leslie Mikesell) for this, which
- works nicely.
-
- > How about going to one directory and doing a:
- > find . -print |cpio -pmd other_directory
- > and then reversing the process. If you don't include the -u flag
- > cpio should not overwrite any files that are newer or the same age
- > and the -m option will keep the timestamp correct on copied files.
-
- I use -pmdv to see what's going on. Too bad -i isn't "interactive"
- like in rm but I should know better than to expect consistency from Unix!
-
- The man pages for cpio actually address this (almost) but all the apropos
- I could think of couldn't find it. Should know better than to expect
- usability from Unix!
-
- > This example shows how to copy the contents of the user's current direc-
- > tory into an archive.
- >
- > ls | cpio -o > /dev/rmt0l
- >
- > This example shows how to duplicate a directory hierarchy.
- >
- > mkdir ~phares/newdir
- > cd ~phares/olddir
- > find . -print | cpio -pdl ~phares/newdir
-
- (Uh oh, I badmouthed someone's religion, now I'm really in trouble ...)
-
- --
- ..........................................................................
- Dan Suthers | LRDC, room 505A
- suthers+@pitt.edu | 3939 O'Hara Street
- (412) 624-7036 office | University of Pittsburgh
-