REQUEST HELP --- Merging Similar Directories.

Leslie Mikesell les at chinet.chi.il.us
Sat Jan 28 15:19:40 AEST 1989


In article <1721 at ektools.UUCP> milton at ektools.UUCP (Milton P. Bordenschnocker) writes:

>    Situation:	I have two nearly identical directories.
 >		One is from a backup, and the other is real.
 >		Both contain files and sub-directories
 >		that the other does not have.

>    Wish list:	I would like a way of merging the two directories,
 >		This needs to be done in such a way that in case of
 >		duplicate files the most recent file is the one used.

If the backup is via cpio you can just restore it into the the current
directory without the -u flag and end up with the newest copies of everything.
Otherwise you can make a cpio copy of your current directory:
  cd dir; find . -depth -print |cpio -ocv >file_or_tape
Then restore your backup copy and update with:
  cd dir; cpio -icvmd <file_or_tape 

Les Mikesell



More information about the Comp.unix.wizards mailing list