View Full Version : Movable Type Cron Job Setup

07-18-2006, 12:27 AM

I am trying to setup a cron job for Movable Type.

1. I have downloaded the software from:

Putty Client Program:

2. Read Movable Type Instructions:

But I keep getting errors.

Movable Type says that I need to use the command crontab -e. I do this and it works fine.
I get another window and it reads.

51 0 * * * /bin/logrotate /etc/logrotate.conf 2>&1 > /dev/null

So what I do is add the following line...

0,15,30,45 * * * * cd /var/www/cgi-bin/mt/; ./tools/run-periodic-tasks

So now the window looks like this:

0,15,30,45 * * * * cd /var/www/cgi-bin/mt/; ./tools/run-periodic-tasks
51 0 * * * /bin/logrotate /etc/logrotate.conf 2>&1 > /dev/null

I hit Ctrl+X to exit, but I get and error:
"/tmp/smash":1: bad ; sign
errors in crontab file, can't install

Am I entering the wrong path to MT?

I hope someone can help out with this.

Thank you in advance.

Note: The MT script is located in the cgi-bin


07-18-2006, 08:16 AM
Rather than trying to cd to the directory first, just give cron the path to the file that it is supposed to run. eg:

0,15,30,45 * * * * /var/www/cgi-bin/mt/tools/run-periodic-tasks

07-18-2006, 11:16 PM
Hi Blender,

Thanks for the input...

I did try adding 0,15,30,45 * * * * /var/www/cgi-bin/mt/tools/run-periodic-tasks

But for some reason it's still not wroking.

Any other ideas?


07-19-2006, 06:50 AM
Do you need to tell it that you want to use perl to run the program? I know with php scripts you have to provide the path to php first then the path to the php script. Does the script work if you access it via a browser?

UPDATE: I found this in regards to running other processes of MT in cron. It includes the path to perl first. http://underscorebleach.net/jotsheet/2005/02/prevent-movable-type-trackback-spam Under Step 4: Setting up the cronjob

07-19-2006, 07:02 AM
Found something else that may be helpful. These post did not envolve MT but the person was trying to run a perl script via cron. http://www.dbforums.com/archive/index.php/t-321309.html

The last person to post mentions that they often create a shell script as a wrapper to a perl script in order to set up the correct enviroment for the script to run in. In other words the shell script changes direcotries and sets any variables needed and such.