Jump to content

Recommended Posts

Posted

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!

Posted

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

Posted
Just create your cron command using this for the command line.

 

>php -q /home/yourusername/public_html/path-to-updateblacklist.php

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.
Posted
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.

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...