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.
The simple script look like this:
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
That works fine as long I put every file in the monitored folder after each convertion from HandBrake.
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.
How can I monitor the folder to queue it with Handbrake?
BTW: the real script is much longer on the command is not just a singe line.