CP Cron (Background Jobs)
Along with the
that H-Sphere puts into its physical servers' crontabs,
there are several background jobs that are executed by H-Sphere on the Control Panel server:
- Accounting - does recurrent billing for end users
- OverLimitCron - checks that the account is not going over the limit
- ResellerCron - does billing for resellers
- TrialCron - suspends expired trial accounts
- RevenueCron - calculates summary billing info
- ContentMovingCron - completes the process of moving user content
- FailedSignupsCron - sends emails about failed signups (every 5 minutes)
- TTAutocloseCron - closes trouble tickets answered certain time ago
- VPSCron - queries the status of creating virtual servers (every 4 minutes)
- ecCron - processes the external_credits table and adds
payments performed within an external payment system outside H-Sphere to this table
as the account credits,
thus integrating external payments into H-Sphere. Read more about
external credits configuration.
CP Cron Configuration
All those cron processes use the last_start table in the H-Sphere database.
This table contains the following fields:
name varchar(20) NOT NULL PRIMARY KEY,
When H-Sphere is restarted, those values are read from this table for each cron.
Field name - CP cron job name as in the list above
(corresponds to the cron tag's name
cron XML configuration file)
Field value - last time that cron was executed
Field last_user - user_id of the last user that was calculated with the cron
(used only for accounting and overlimit).
Changing the launching time
(deprecated since HS 2.4)
To change the launching time for all future dates,
Log into the system database and
change the last time the cron was executed:
update last_start set value = '2003-03-24:TIME-05' where name in ('NAME');
TIME is the actual time in the format YYYY-MM-DD:HH:MM:SS
-05 in this example means hours of difference with GMT (Greenwich Mean Time);
GMT-05 corresponds to EST (New York).
For Central Europe, this value will be +01.
NAME is the name of the cron job.
For example, to change the time of the accounting cron, execute:
hsphere=# update last_start set value='2003-03-24:06:00:00-08' where name='LAST_LAUNCH';
CP Cron XML Configuration Files
(HS 2.4 and up)
From HS 2.4, CP cron settings are defined and customized in the corresponding
XML configuration file Here, you can
add new custom CP crons and/or change cron job settings such as priority, starting time and period.
Such customization can also be done by means of
Background Job Manager
(version 2.4 and higher)
Background Job Manager is a utility that allows to enable, start and
disable selected cron jobs from CP interface.
Cron jobs are available from the Admin control panel,
the Background Job System section.