I want to monitor a directory on my server for additions (or file update), and when something is added, run a php script.
I saw that there is watch
, but I'm not sure exactly how to use it.
I know watch -d ls -l
will track changes in the file listing, but then how do I pipe the changed file to a php script? Also, how do I watch for a file that is not new, but updated?
Can I run this alongside a config file (what directories, etc) for easy setup to end users?