Monitor folder with inotifywait in bash for queue
<p>I want to use inotifywait to monitor a special folder to convert the files with HandBrake. I move the file in the monitor_folder manualy.</p>

<p>The simple script look like this:</p>

<pre><code>inotifywait -mrq -e moved -e create --format %f /media/user/monitor_folder | while read FILE
do
    sleep 2
    HandBrakeCLI -i /media/user/monitor_folder/$FILE -o /media/user/finished/$FILE -e x264 -q 20 -B 160
done
</code></pre>

<p>That works fine as long I put every file in the monitored folder after each convertion from HandBrake.</p>

<p>inotifywait seems not to monitor the folder while HandBrake works. Even if I put two files at the same time in the monitored folder : only the first is file is converted by HandBrake.</p>

<p>How can I monitor the folder to queue it with Handbrake?</p>

<p>BTW: the real script is much longer on the command is not just a singe line.</p>