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

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

I am glad you solved it. Good to know.

--
Regards
David Ward
----- Original message -----
> Thanks for the pointer,
> 
> However the IN_CREATE picks up on the same thing, the creation of RSYNC's
> temp file.     However I've tried IN_MODIFY and IN_SELF_MOVE and they're
> not picking on the transition from .myvideo.mp4.3sdsdf4 to myvideo.mp4
> 
> Chris -.
> 
> On Wed, Jul 28, 2010 at 1:18 AM, David Ward <david_at_dward.us> wrote:
> 
> > 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
> > 
> > 
> 
> 
> -- 
> Chris Williams
>   http://imnotplayinganymore.com/http://twitter.com/scampiukhttp://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