Re: Watching for rsync write files but getting the temp name

From: David Ward <david_at_dward.us>
Date: Wed, 28 Jul 2010 10:18:56 +1000

I use this for a similiar purpose.

/update/ IN_CREATE /usr/local/bin/updatepuppet

But the files created there are by NFS mounting that dir on the client and
touching a file there.

Maybe try scp?

-- 
Regards
David Ward
On Tue, 27 Jul 2010 18:32:00 +0100, Chris Williams  wrote:  
Hi,
I've set up a incron watch on a folder which we use to receive files via
rsync from other servers. Here's what I have in my `watchfiles` file in
/etc/incron.d/
 /path/to/dir/10a IN_CLOSE_WRITE /path/to/scripts/linkfiles $@/ $#
and the script `linkfiles` is very simple also...
 #! /bin/bash
 echo "Looking in $1 at $2 " >> /var/log/incron/incron.log
 ln -s $1/$2 /path/to/new/dir/$2
which is all well and good and works when we create files by hand, copy
them in etc. When it fails is when we rsync somthing into that folder.
Here's the log entry
 Looking in /path/to/dir/10a at .myvideo.mp4.Y3iTGF 
Augh! As I see it, the IN_CLOSE_WRITE is catching the file as rsync writes
the temp file before it renames it. For some reason it's not catching the
correctly named file (myvideo.mp4) but the temp name one.
Can someone point me in the right direction? Is IN_CLOSE_WRITE the correct
way to do this?
Thanks,
Chris -.
-- 
Chris Williams
 http://imnotplayinganymore.com/ [1]
 http://twitter.com/scampiuk [2]
 http://facebook.com/chris.scampi.williams [3]  
 
Links:
------
[1] http://imnotplayinganymore.com/
[2] http://twitter.com/scampiuk
[3] http://facebook.com/chris.scampi.williams
Received on Tue Jun 05 2012 - 22:14:21 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2012 - 22:14:21 CEST