[X-Unix] shell scripting

Brian Medley bpm-list-osx-unix at 4321.tv
Thu Jan 15 19:34:51 PST 2004


On Fri, Jan 16, 2004 at 04:16:08AM +0100, Joaquin Henriquez Alzola wrote:

> You do this with the find command use the -mtime

ahh..jolly good...forgot the wonderful find options...

so:

    cd $src_dir
    find . -newer reference_file -print0 | xargs -0 -J % cp % $dst_dir
    touch reference_file

Should work?

But I like the rsync option best, b/c, as best as I can tell, it
wouldn't have the race condition of files being missed b/c they were
inserted into the directory after the find command was finished finding
files, but before the touch command.

-- 
~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-., \|/  (___)  \|/ _,.-=~'`^`
                                               @~./'O o`\.~@
               "Knowledge is Power"           /__( \___/ )__\  *PPPFFBT!*
                  -- Francis Bacon               `\__`U_/'
 _,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~= <____|'  ^^`'~=-.,__,.-=
~`'^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-==--^'~=-.,__,.-=~'`^`



More information about the X-Unix mailing list