Helpful Information
 
 
Category: Solutions
Movable Type Cron Job Setup

Hello,

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

1. I have downloaded the software from:

Putty Client Program:
http://www.chiark.greenend.org.uk/~sgtatham/putty/

2. Read Movable Type Instructions:
http://www.sixapart.com/movabletype/docs/3.2/11_advanced_topics/configuring_schedule_posts.html


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

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

http://www.WebSiteURL.com/cgi-bin/mt/

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

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?

greg

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

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.










privacy (GDPR)