Automatic b2evo Antispam Updates with Cron

In my previous go at this concept, I had automated the updates with a client-side script that opened up Internet Explorer to the URL to get the antispam update.

However, as all you Windows users probably know, the scheduled task feature in XP isn’t all that reliable. Plus, it just seemed utterly klugey to me.

I decided to do it with a CRON, but wget isn’t allowed on my host, so I couldn’t do it like Jason Edgecombe did.

I decided to go another route. Read on for the how2.

Requirements

No Loggin In

I don’t want to have to worry about logging in, which means that I don’t want to have anything running any dangerous adminly URLs.

Server-Side

This means a cron-job, running a php script. Since I’m not allowed to use wget in a cronjob with TotalChoiceHosting, this means that it would have to be a straight php execution, and this means that I couldn’t pass $_GET variables to the script.

Solution

This is the script that I created. All that it does is poll b2evolution.net for an update. No access to any other adminly things, and frankly, I don’t care WHO updates my list, so if you want to, go ahead!

I saved this as b2antispam_poll.php and saved it in the admin directory.

[The requested file /home/yaohytmw/isaacschlueter.com/download/b2evo/b2antispam_poll.php could not be found]

Then, I set up a cron like so:0 */6 * * * /usr/local/bin/php /home/my_username/public_html/admin/b2antispam_poll.php
That says: every 6 hours on the hour, call the php executable and have it run this script.

It’s been working like a charm, and even sending emails to me to let me know what it does!

3 Responses to “Automatic b2evo Antispam Updates with Cron”

  1. On May 2nd, 2005 at 12:33:23, basstech Said:

    My host tells most people that they don’t allow it. They have it installed on the server, but most users don’t have permissions to it. They have it hardlinked as tegw (wget backwords). I use it on my blog to call the blog by email script and to update my blogroll.

    They’re not the first one’s that I’ve seen that did that. You might want to setup a test cron job and try it out or if you have shell access just try and run tegw from a shell.

  2. On June 27th, 2005 at 15:09:15, Graham Said:

    How did you get it to run edb’s re-check hack automagically as well?

  3. On June 27th, 2005 at 16:27:44, Isaac Schlueter Said:

    By popular demand:

    http://isaacschlueter.com/2005/06/b2evolution_antispam_recheck_cronjob/

Leave a Reply

Comments are moderated like crazy using a variety of plugins. There is a very high likelihood that your comment won't show up right away, especially if you have never commented here before, but it was not deleted.

Please be patient, and do not post your comment more than once. It will show up once it is approved.

You must be logged in to post a comment.