Questions answered by this recipe
How can I be notified when someone modifies files in a directory tree on the server?
Recipe for notification when files change on the server.
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.
- Download the script and place it in 'cookbook/'.
- Add something like the following to your configuration file:
$FilesNotify['mailto'] = array('email@example.com'); include_once("$FarmD/cookbook/filesNotify.php");
- First release of recipe.
- Christian Ridderström -< ~chr? - Created original version of this recipe. Contact him through the pmwiki developers' list.
See discussion at FilesNotify-Talk