Online Chat
 Call Us: 
Browse Submit a Ticket
Advanced Search
Rss Categories

Setup Cron job on Linux/UNIX via command line

Author: Edward Hardin Reference Number: AA-00484 Views: 11886 Last Updated: 01/04/2011 04:20 PM 0 Rating/ Voters

To setup KMP Cron job, edit a crontab file through the command line. To do that, type:

crontab -e

If this fails you need root access. Try:

sudo crontab -e

You need to add the following line to the crontab.


* * * * * %PATH-TO-PHP% %PATH-TO-KMP%/admin/CRON/cron.php %URL-TO-KMP%


* * * * * - condition that tells cron to run this job every minute.

Replace %PATH-TO-PHP% with path to PHP executable file. If you don’t know the path to PHP, then you can ask your server admin. Here are some examples of possible paths to PHP:


Replace %PATH-TO-KMP% with physical path (not URL) where you have installed KnowledgeBase Manager Pro. If you know the path to your account, then you can simply add the remainder of the path to your actual script e.g. /home/user1/public_html might be the path to your account (document root) and the script might be in kmp/admin/CRON/cron.php resulting in /home/user1/public_html/kmp/admin/CRON/cron.php

Replace %URL-TO-KMP% with URL to location where you have installed KnowledgeBase Manager Pro (if open this URL in your browser, you'll see the front-end part of your knowledge base).


* * * * * /usr/bin/php /usr/www/kmp/admin/CRON/cron.php

Please, do not forget the slash at the end of the last parameter.

This is correct:

This is incorrect:

Open the KMP control panel and go to Administration > General Settings > Auto Related Articles. You may see the following message there previously: "You have to setup cron script in order to use this functionality."

This message will disappear after the first run of the Cron script. Click "Recheck"  in about a minute to see that Cron job has been successfully installed.

Alternative cron command

There is also another way to run KMP cron. You can do this via wget. Use it if the example above doesn't work for you for some reason.


* * * * * wget -q %URL-TO-KMP%/admin/CRON/cron.php 1>/dev/null 2>&1


* * * * * wget -q 1>/dev/null 2>&1