inotifywait only in specific dir, specific type of file
I spent a lot of time but no lucky.
I want to trigger action when in specific dir (and only in that dir) will be new file. This dir contains films so transmission of such file take several minutes. It could be MKV or MP4 file. I want to trigger action when file will be closed, that is transmission ends. Other types of files in this dir should be ignored by inotifywait. Any advice how looks like proper syntax of such inotifywait command? |
|
I read it but if I want specify wildcards in filename (like *.mkv) it does not work. Look at the command line I use. Where is an error?
Code:
inotifywait -e close_write /path_to_dir/*.mkv |
Although you should be able to find some examples here is a basic bash script to watch a directory. You can add code to test for mkv or mk4 extension.
Code:
#!/bin/bash |
All times are GMT -5. The time now is 11:20 PM. |