Cron Jobs and MT

Learning Movable Type has an interesting post about scheduled postings and cron jobs. A cron job is an automated task set to run in the future. If you have MT 3.1x, you have probably noticed you can save a post as “draft,” “publish,” or “future.” In order to make use of the “future” post status, you need to create a cron job.

Elise and Arvind do a wonderful job explaining how to do this, and their tutorial works very well, although I noticed my post did not occur *exactly* when I set it to occur; however, it posted soon after that. It was probably my server and nothing to do with their instructions.

When might you want to save a post for a future date?

  • When you want to commemorate a special event, like a birthday, holiday, anniversary, etc.
  • When you are going out of town, but want to continue to post to your blog, because daily posting (or something close to it) is important to you.

I did not find, as Elise and Arvind indicated, that the cron job needed to be set to run every fifteen minutes of every hour, day, week, and month, but my server’s cron job configuration may be different. That just seemed a little excessive to me.

How will you know if it works? Well, I set this to post on Friday morning. If it works, then you’re reading this. I promise not to cheat and change the draft status to “publish” if it doesn’t.

Update: It appears to have worked! By the way, I figured out the issue with cron job not running as scheduled. The folks who host PlanetHuff are located in the Pacific time zone. The cron job I set to run at 8:00 actually ran at 8:00 PDT, which was 11:00 EDT. You may want to find out if you would have the same problem. Also, make sure the permissions to your file “run scheduled tasks” located in your “tools” folder under wherever you have MT installed, are set to 755. I tried to run a cron job on my other web site and received a permission denied error, because I forgot to change the permissions.