Home  RDF/RSS 1.0  RSS 0.92  RSS 2.0  Atom  Comments [RSS 2.0] 

[3-June-2005]

I’ve got my cron job working…

Filed under: Tech Tech — @ 8:07 EDT

Got the cron job working to pick up mail and create a blog entry automatically. Other PowWeb users often ask how to do this, so here’s some quick instructions:


You have to create an "etc" subdirectory that will contain your "crontab" file. This is at the root of your web site, even with the "htdocs" subdirectory. Use
Sitemanager to create it.

Create a file call crontab (no extention) on your local machine using notepad or
whatever basic text editor you use. The "crontab" file will contain two lines:
one that will run the script every so often and a blank line. The first line
will look something like this:

0 * * * * /usr/local/bin/php $HOME/htdocs/<wordpress install>/wp-mail.php

The "0" runs the script every hour, on the hour.
The "/usr/local/bin/php" calls the php executable
The "$HOME/htdocs/<wordpress install>/wp-mail.php" calls the wordpress mail
script.

Permissions for "crontab" seem to work when they’re set to "644" (owner
read/write, group read, other read)

Optional:
Create a subdirectory at the same level as "etc" and "htdocs" and call is "logs"
Tack this on the end of the crontab line so you can see the results of the cron
job: >>$HOME/logs/wpmail.log 2>>$HOME/logs/wpmail.err

So now the line looks like this:
0 * * * * /usr/local/bin/php $HOME/htdocs/<wordpress install>/wp-mail.php
>>$HOME/logs/wpmail.log

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.



Content © 2005-2006 Valence Band Productions | CSS | XHTML | Theme by H P Nadig and Weblogs.us