I'm trying to put together a shell script the detects when rsync changes
a file.  I'd prefer not to have to store meta data in files, so I'm
looking at using the atime and the mtime of the file and the -N file
test operator in bash which returns true if the mtime == the atime for
the file.

The problem I'm having is that rsync is updating the mtime even when it
doesn't change the file. so -N is returning true every time.  My plan
was to run rsync without the -t flag so when it creates or updates a
file the atime == the mtime,  then check that with -N and then touch -a
the file to update the atime so it's ignored untill it's updated again. 
But since rsync is updating the mtime every run. that's not going to
work.

The other option is to use the -t flag in rsync except that the mtime
will now be the mtime of the original file. I don't know how using that
would be useful without storing it as meta data and comparing the mtime
to it.  Something I'd prefer not to do.

Any other ideas would be appreciated, I hope I'm missing something
simple.




-- 
Jeff Bearer, RHCE
Webmaster, PittsburghLIVE.com
Winner 2002 Eppy Award, Best U.S. Newspaper Website



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to