(This solution may not scale well if there are many directories, but you'll be able to adapt to your case)
Create a fifo (mknod -p fifoname) and have a script continuosly read from it. If there's nothing in the FIFO the process won't consume resources.
Programs to run are simply inserted in the FIFO as strings; in the cron job, you substitute the script execution with a write into the FIFO, i.e. you prepend echo and append a redirection to the FIFO. The reader script will extract and execute them, via some eval mechanism, or fork(), or whatever you like.
There are tons of theme variations, but I think this should give you the idea.
Flavio
Don't fool yourself.In reply to Re: Locking/unlocking program execution using a queue
by polettix
in thread Locking/unlocking program execution using a queue
by RazorbladeBidet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |