Path To Php?

admin

Administrator
Staff member
I am trying to run a script that will update my MT_Blacklist automatically, <a href="http://blog.codefront.net/scripts/blacklistupdater/" target="_blank">Blacklist Updater</a>. 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 <br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->0 */2 * * * /path/to/php /path/to/updateblacklist.php<!--c2--></div><!--ec2--> 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.<br /><br />Thanks for the help!<!--content-->
Hi Kathy, you don't need to know the path to php. Just create your cron command using this for the command line.<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->php -q /home/yourusername/public_html/path-to-updateblacklist.php<!--c2--></div><!--ec2--><!--content-->
Thank you for your speedy reply.<!--content-->
<!--QuoteBegin-TCH-Bruce+Feb 26 2005, 06:14 PM--><div class='quotetop'>QUOTE(TCH-Bruce @ Feb 26 2005, 06:14 PM)</div><div class='quotemain'><!--QuoteEBegin-->Just create your cron command using this for the command line.<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->php -q /home/yourusername/public_html/path-to-updateblacklist.php<!--c2--></div><!--ec2--><br /><div align="right"><a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=116762"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><!--QuoteEnd--></div><!--QuoteEEnd--> 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.<!--content-->
<!--QuoteBegin-Kathy_P+Mar 6 2005, 02:07 PM--><div class='quotetop'>QUOTE(Kathy_P @ Mar 6 2005, 02:07 PM)</div><div class='quotemain'><!--QuoteEBegin-->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.<br /><div align="right"><a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=118193"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><!--QuoteEnd--></div><!--QuoteEEnd--><br />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.<!--content-->
David is correct. Unless the script is outputting info when it's successful you should not receive an email.<br /><br />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.<!--content-->
I'll get in touch with the creator of the script to see if he can help me troubleshoot it.<!--content-->
 
Top