Kathy_P Posted February 26, 2005 Posted February 26, 2005 I am trying to run a script that will update my MT_Blacklist automatically, Blacklist Updater. I believe I have the files configured and uploaded to the right place. Now I need to set up a cron job. The author of the script gives >0 */2 * * * /path/to/php /path/to/updateblacklist.php as an example, which he says will update every two hours. (I think every 12 hours would be plenty often enough for me.) I don't know what the path to PHP is. I'm pretty sure the path to updateblacklist.php would be mydomainname.com/blacklistupdater/updateblacklist.php . If this is incorrect, please let me know. If I understand how to write the command line, I think I can configure the rest of the cron job, based on other threads I have read here. Thanks for the help! Quote
TCH-Bruce Posted February 27, 2005 Posted February 27, 2005 Hi Kathy, you don't need to know the path to php. Just create your cron command using this for the command line. >php -q /home/yourusername/public_html/path-to-updateblacklist.php Quote
Kathy_P Posted February 27, 2005 Author Posted February 27, 2005 Thank you for your speedy reply. Quote
Kathy_P Posted March 6, 2005 Author Posted March 6, 2005 Just create your cron command using this for the command line. >php -q /home/yourusername/public_html/path-to-updateblacklist.php <{POST_SNAPBACK}> I've got it up and running and it seems to be working fine. At least, I get an email every morning with the above command line as the subject and a blank message area. I'm wondering if there's a way to set it up so I only get the email if there's an error or other problem. It seems silly to get a blank email every day. Quote
TweezerMan Posted March 6, 2005 Posted March 6, 2005 I've got it up and running and it seems to be working fine. At least, I get an email every morning with the above command line as the subject and a blank message area. I'm wondering if there's a way to set it up so I only get the email if there's an error or other problem. It seems silly to get a blank email every day. <{POST_SNAPBACK}> Actually, you are only supposed to get an e-mail when there is a problem. When a script is run from cron, *any* output by the script is e-mailed to you. I suspect that somewhere in the script, a blank line is inadvertantly being output, resulting in the e-mail you're seeing every day from cron. Quote
TCH-Bruce Posted March 7, 2005 Posted March 7, 2005 David is correct. Unless the script is outputting info when it's successful you should not receive an email. I set a cron job for a backup using a script I did not write and was surprised when I started getting emails from the cron job when in fact it had completed. It was sending a success email as well as a fail email. I modified the script to only send email when it failed. Quote
Kathy_P Posted March 7, 2005 Author Posted March 7, 2005 I'll get in touch with the creator of the script to see if he can help me troubleshoot it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.