Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bria!mike Newsgroups: comp.unix.misc Subject: Re: smart copy/update routine Message-ID: <410@bria> Date: 31 Jan 91 05:53:33 GMT References: <1991Jan28.155450.24449@cec1.wustl.edu> Reply-To: uunet!bria!mike (Michael Stefanik) Organization: Briareus Corporation, Los Angeles, CA Lines: 20 In an article, beard@informatics.wustl.edu writes: |Is there such a thing available as unix source? What I need is a |program that can be told to copy files from source to target iff the |file to be copied does not exist on the target or the source version |is newer than the version in the target directory. (A useful option |would be to change the above "or" to an "and," so that only files |already present at the target would be copied, and only if the source |version were newer. How 'bout this ... find src -exec find dest -newer {} -type f -print \; | sort | uniq |\ while read file; do [ -f dest/`basename $file` ] && cp $file dest; done -- Michael Stefanik | Opinions stated are not even my own. Systems Engineer, Briareus Corporation | UUCP: ...!uunet!bria!mike ------------------------------------------------------------------------------- technoignorami (tek'no-ig'no-ram`i) a group of individuals that are constantly found to be saying things like "Well, it works on my DOS machine ..."