Help - Search - Members - Calendar
Full Version: Auto Email Message When A Directory Changes
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
OPC
Not sure if this is the right place for this but...

First, I am a newbie so I will need a lot of instruction.

I am currently using a cron job within cPanel to email me a specified directory and those directories and files within it. I get this at a specified time each day but would rather only get an email when a directory changes. Within this email I would like to know the following changed information:

1. Directory Name
2. File Name
3. File Size
4. Date of the file that has changed

Is there a way to do this and to have it in an easily readable format?

Thanks,

Dave.
wozzym
hmm this would be tricky trying to get it to do say all of that stuff but ill try if i have time. smile.gif
OPC
Thank you very much for taking the time to help.

Dave.
mathew edison
Right after a few minutes of google I came up with a possible plan of action tongue.gif I'm gonna be straight forward with you, I wouldn't know how to code for these actions however somebody else might. In Cpanel you want to direct the cron job to a php file, more info on this can be found here. http://www.webmasterworld.com/forum88/6102.htm
Then the PHP file should use the dir function which comes with PHP and all data related to the files should be read. In a database the date should be stored on the execution of the PHP script so that the next time the script gets runned by cron job you can check the last edited date of the file against the last run date of the cron job. This would probably be the complicated as I usually think the complicated way however if you find a good web developer he/she might be able to help you work this out the right way 0.o
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.