I use incron for watch a direcory and run a script if a file is added.
In /etc/incron.d/ I have a file with:
/home/pat0/downloads IN_CLOSE_WRITE /var/www/owncloud/scanOC.sh pat0
It's ok when I add a file in /home/pat0/downloads but, if I create a subdirectory and I add in a file no thing run.
For exemple /home/pat0/downloads/test/myfile.txt is not seen.
How can I watch /home/pat0/download and all its future subdirectories and files?
No, I don't think this is possible with incron. Please check with Watcher.
Watcher is a daemon that watches specified files/folders for changes and fires commands in response to those changes. It is similar to incron, however, configuration uses a simpler to read yaml file instead of a plain text file. It's also written in Python, making it easier to hack.