[CentOS] Detect file change

Tue Jan 26 14:10:47 UTC 2010
Les Mikesell <lesmikesell at gmail.com>

Alan Hoffmeister wrote:
>> You could just run rsync periodically without checking anything.  It will only
>> transfer files that have changed and will walk the whole tree doing the
>> comparisons with the -R or -a options.
>>
>>    
> Yeah i know, but my work is sync lots of small files (hundreds of them), 
> and rsync will stay all day to check all that files on the remote host...

"Hundreds" is not a big number for rsync - but many thousands might be since it 
will always transfer the whole directory listing for the comparison.  If you 
have room for another local copy of the files you might rsync locally, then 
repeat to the remote only if files were transferred.  Otherwise you'll at least 
need to write a script that touches a file to set a current timestamp, then runs 
find -newer to detect modified files in the tree in question - or hook to 
inotify which always seemed experimental to me.

-- 
   Les Mikesell
    lesmikesell at gmail.com