On 21 Nov 2002, Jeff Bearer wrote: > 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 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.
You would be better off to have the script that runs the rsync itself do it. Look at ssh to do this securely: rsync and log the output. Then if whatever file you are interested in changes, you can detect it in the log. ssh can then kick off whatever process remotely you need. -- \ \/ / _ |~\ _ In God We Trust. All Others Pay Cash. > < / \|\ /|+-< | | "The world is a comedy to those that think, / /\ \\_/| \/ ||__)|_| a tragedy to those who feel." - Horace Walpole -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list