Setting Up Cron Jobs
The tutorials & screenshots below demonstrate how to configure the WHMCS cron on the most common hosting control panels.
You can obtain the exact cron command you need to use for your installation from Setup > Automation Settings at any time.
The examples below will setup the cron to run at 9am every day.
Click on the Cron Job icon in cPanel, select the Once A Day option from the Common Settings dropdown menu. Then paste the cron command into the Command field.
Alternatively click the Advanced (Unix Style) button and use the following:
< on the server setup and you should check with your Server Administrator for the full path to the php binary.An example command to run is:DotNetPanelNavigate to the hosting space in which WHMCS is installed and click Scheduled Tasks from the Hosting Space Menu, then clickAdd Scheduled Task.From the Task Type dropdown menu select the Check Web Site Availability option and enter the URL of the cron.php file into the URL field. Use the Schedule options to run this task Daily and finally ensure it’s active and running.Windows ServerDepending on your server setup, you can run the cron directly from the php executable. If this is not possible, you would need to use the server browser to run the cronAn example command to run is:You should then set the task to run at a certain time every day. The time is up to you.PleskYou can specify the php command using the following on Linux Plesk:env php -q /home/user/whmcs/admin/cron.phpThe Windows version of Plesk is slightly different. You need to specify the path to the php executable and then specify the path to your cron.php file.Check the appropriate boxes to run at the time you wish and press ok to save.HelmInterWorxOption FlagsPassing in option flags to the cron process allows you to customise the actions that get performed. By default, all actions will run but you can pass in any of the flags below to skip or only do certain processes.In WHMCS 5.2, the option flags were expanded to include do options for when you only wish to run a specific action or two as the cron runs.Flags
- affreports – First day of the month only
- overagesbilling – Runs on the last day of the month only.
How to use Option FlagsFlags are passed in by simply appending them to the cron command. All the flags can be preceded with do_ or skip_. When running with do_, the cron will only complete the actions listed, everything else will be skipped. When using skip_, WHMCS will run all other commands except those defined.Skipping ActionsFor example to not run CC processing you could use “php -q /home/username/public_html/admin/cron.php skip_ccprocessing” or alternatively as a browser request, like this “get http://www.yourdomain.com/admin/cron.php?skip_ccprocessing=1″To skip multiple items the following format can be used “php -q /home/username/public_html/admin/cron.php skip_ccprocessing skip_usagestats” or alternatively “get http://www.yourdomain.com/admin/cron.php?skip_ccprocessing=1&skip_usagestats=1” Doing Specific ActionsIn some instances, it is easier to define the actions you wish to complete rather than those you do not. For example, if you wished to take a backup of your database more regularly than once per day, you could schedule the command “php -q /home/username/public_html/admin/cron.php do_backups” or alternatively as a browser request, like this “gethttp://www.yourdomain.com/admin/cron.php?do_backups=1″In this way, you can also complete actions separately that you may have skipped with a separate cron. Perhaps you want to separate when your CC processing and usage information updates are completed. To do multiple items, the following format is used “php -q /home/username/public_html/admin/cron.php do_ccprocessing do_usagestats” or alternatively “gethttp://www.yourdomain.com/admin/cron.php?do_ccprocessing=1&do_usagestats=1”
|/usr/bin/php -q /home/demo_user/domains/testdomain.com/public_html/whmcspath/admin/cron.php|
|/usr/local/bin/php -q /home/demo_user/domains/testdomain.com/public_html/whmcspath/admin/cron.php|
|wget -O http://www.yourdomain.com/whmcspath/admin/cron.php|
|C:phpphp.exe -q “C:inetpubwwwrootwhmcs7admincron.php”|
|“c:program filesinternet exploreriexplore.php” “http://www.yourdomain.com/whmcspath/cron.php”|