In reply to Philip:
> Are you using one script?
> It might be better to keep the inotify as one process and the processing of the CSV as something spawned. That way the inotify script can spawn successive processing jobs without waiting for them to end. You'll need to make sure you database can handle multiple processing jobs or manage the jobs.
> You also need to a handle event overflow with inotify, there is some basic info in the man page.
Indeed it seems a better choice and that way you can simply make the spawned process stay in a wait loop if there is another instance running, if you don't want two imports running at the same time.