Cron

Command variations

Wget:

 wget -O /dev/null -q http://your-domain.ru/directory_tds/cron.php

CURL:

 curl -s http://your-domain.ru/directory_tds/cron.php > /dev/null

PHP:

 php -f /full_path_to_tds/cron.php

PHP CLI:

 php-cli /full_path_to_tds/cron.php > /dev/null

Note: To make sure commands are working,it is highly recommended to launch them in server console

How can I find out the path to cron.php script?

To find out the path in php info create the script with the code:

 <?php phpinfo(); ?>

ISPManager

ISPManager 5

Turn on the expert mode. Insert the command and insert * (an asterisk) in all the other fields.

Direct Admin

  • Minutes: *
  • Hours: *
  • Days of the Month: *
  • Months: *
  • Days of the Week: *

Command: wget -O - -q -t 1 http://domain.com/cron.php

Crontab (Ubuntu, CentOS, Debian)

Run:

$ crontab -e

The VIP will be opened. Press ā€œiā€, then paste:

* * * * * php /full_path_to_tds/cron.php

Press ESC and type the command :wq, Enter. You'll see a message that cron has been updated.

cPanel

cpanel.jpg

For what reasons cron does not work?

  1. ioncube is not connected at PHP-CLI . Check it by running the command from a server console.
  2. The script is interrupted by an error. Check the error log var/log/errors.log.
  3. The path to the file cron.php is not correct. Check it by running the command from a server console.
  4. Curl (wget) is used but it`s not installed on the server. Try both variants: with wget and curl.