Of course, one of the first things I wrote in the script is a lock. In that case, it uses Proc::Processtable to make the script exit if it is already running on the same history file. But that was not enough.
Then I discovered IN_NO_LOOP. This optional parameter in incrontab is described this way:
Additionaly, there is a symbol which doesn't appear in the inotify symbol set. It is IN_NO_LOOP. This symbol disables monitoring events until the current one is completely handled (until its child process exits).
This solved my problem. When an history file is changed, incron fires the command and disables the monitoring on this history file until the command returns.


0 comments:
Post a Comment