FilesNotify
Questions answered by this recipe
How can I be notified when someone modifies files in a directory tree on the server?
Description
Recipe for notification when files change on the server.
Notes
This recipe was written to monitor files that change at http://wiki.lyx.org. That site uses an external file manager. At one time a spammer actually used the files themselves to spam (using files names containing sensistive words etc). Changing the password for the file manager fixed that problem, but now there's a need to once again let the password become more public. As a counter measure against abuse, this recipe was created to send e-mails when it noticed that files have changed in a directory tree (i.e. in uploads/).
How it works: The script will create a listing of all files in the directory tree, and then compare this listing to a previous listing. If they are different, an e-mail is sent with the difference.
Creating the file listing may be time consuming, so this script is at most run once a day by default. If no one browses the wiki, then this script will not be run at all and changes will not be detected.
See the script itself for further details.
Installation
- Download the script and place it in 'cookbook/'.
- Add something like the following to your configuration file:
$FilesNotify['mailto'] = array('christian.ridderstrom@gmail.com'); include_once("$FarmD/cookbook/filesNotify.php");
Release Notes
- 2007-01-21
- First release of recipe.
See Also
?
Contributors
- Christian Ridderström -< ~chr? - Created original version of this recipe. Contact him through the pmwiki developers' list.
Comments
See discussion at FilesNotify-Talk
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.