I know has been a bit of discussion about topics similar to this. But here is what I am basically trying to do.
I have a watch directory called watched and whenever a file is added to that directory, I want to trigger a script called syncbh.sh which will take files out of that directory and upload them to a remote server.
The caveat is that files are created in the watched directory by one user (user2), but the script is executed by another (user1).
I've tried using incron to accomplish this, but keep running into a major problem because while the script can be executed manually by user1 with root privileges, the incron daemon is never actually automatically triggered by a file creation event by the other user2.
I've thought about whether inoticoming would be a better alternative, but I'm unclear about how the syntax of this works. If there a better way to accomplish this, or if I end up using inoticoming what would the command syntax be to ask it to watch /home/user1/watched directory and execute the script /usr/local/bin/syncbh.sh if a file is created/modified within that directory?
Any help would be much appreciated.