On Sat, Apr 12, 2008 at 6:06 PM, david <[EMAIL PROTECTED]> wrote:
>  Thanks everyone.
>  For the archive, this is where I finished up - seems to work so far:
>
>  while inotifywait -e close somefile; do
>         <some stuff, including a short sleep [1] >
>         while lsof foo/*.tif > /dev/null ; do
>                 sleep 10                # because they are big files
>         done
>         rm foo/*.tif
>  done
>
>  [1]
>  I wonder about timing issues. "somefile" is a 3 byte counter which is
>  the first thing updated by another program, which then creates the tif
>  files. I want my script to do it's thing after all that.
>
>  What happens if the lsof test happens before the tif files are first
>  opened for writing? Am I worrying too much?
>
>  I've put a sleep into <some stuff> in case that's a problem. For my job
>  it doesn't matter if there is a sleep in there.

Have you looked into tracking the processes instead of the files? Can
you identify a single process who's life-span matches the time that
the files are being created?

--Amos
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to