[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: wait till end of write, how?



On Mon, May 07, 2001 at 10:27:06AM +0200, Emil Pedersen wrote:
> > > And if you can't do that, just have the script checksum the file every 5
> > > secs, and if it hasn't changed for 10 secs, you're probably set.
> > >
> > > Use the suggestion from Rick first though.
> > 
> > Since the W2k client users just copy the relvant files using drag'n'drop
> > something like a semaphore file is not possible.
> 
> 
> Just a thought;  shouldn't it be posible to use 'lsof' to see when the
> file gets closed?
> 
Hmm, yes that might work...

if [ -z "$($lsof $file|grep ^samba)" ]; then
....
fi

That'll test for samba usage, and only samba.  You need to test the output
of your lsof and see how it reacts to this command.  My lsof gives zero
output if it doesn't find any open files, and list plus header when open
files are found.

Mike



Reply to: