I've got a client that wants to be notified anytime there are new files in their directory on a shared host. Since the directory is a website, which caches files to a specific subdirectory, we want to be able to ignore changes to that subdirectory.

Is there a tool that can do this already? Or a shell script?

It would be great if the results could be emailed as well.

link|improve this question
1  
Telling what OS you run would help. – jlliagre Jun 17 '11 at 10:19
Yes, this can be done but the implementation is OS, and possibly even filesystem, dependent. – John Gardeniers Jun 17 '11 at 12:00
feedback

migrated from stackoverflow.com Jun 17 '11 at 9:11

This question came from our site for professional and enthusiast programmers.

1 Answer

If possible,, use incron. It uses Linux kernel inotify feature (which basically sends signals to user-space every time some wanted file/directory is altered) and can be configured for example to run a script every time some file or directory is somehow modified or accessed. With incron you can get the alerts in real time.

link|improve this answer
And what if it's not a Linux machine? – John Gardeniers Jun 17 '11 at 11:59
Then we'll think again. :-) I'm betting in this case this is about Linux. – Janne Pikkarainen Jun 19 '11 at 18:33
feedback

Your Answer

 
or
required, but never shown