H-Sphere Documentation Developer Guide


CP Cron Configuration

(version 2.4 and higher)


Related Docs:   Adding Custom CP Cron Jobs CP Cron Jobs Background Job Manager (Admin Guide) Cron Scripts

Control Panel cron configuration is represented in XML format in the ~cpanel/shiva/psoft/hsphere/cron_config.xml file. Its location is set by the CRON_CONFIG parameter in hsphere.properties:

CRON_CONFIG = /hsphere/local/home/cpanel/shiva/psoft/hsphere/cron_config.xml

DTD Scheme | Example

Cron jobs are grouped according to their purpose. Default group is CRON. Cron groups are set in the group constructions that contain the job tags describing jobs in these groups:

  <group name="CRON" maxpriority="10" defpriority="3">
  <!-- priority of jobs within the group is ranked from 1 to 10;
       if job priority is not specified, it is 3 by default -->

    <job name="CustomCron" class="custom.cron.CustomCron" db_mark="C_CRON"
      starttime="now+15m" period="15"/>
    <!-- job starts in 15 minutes after CP start and runs every 15 minutes -->

Group attributes:

  • name - group name;
  • disabled - group jobs are all disabled if disabled="1". If not set, disabled is set to 0 (enabled);
  • maxpriority - sets the maximum number to which job priority within a group is scaled. For example, if maxpriority is 15, then job priority within a group is from 1 to 15, where 1 is the least priority, and 15 is the maximum priority. If this option is not set, maximum priority for a group is 10 by default;
  • defpriority - set the default job priority. If the job's priority attribute is not set, the job priority will be equal to the group's defpriority value.
  • defperiod - sets the default launching period for group jobs, in minutes;
  • maxjobcount - maximum number of jobs in the group running at a time.

Job attributes:

  • name - job name;
  • class - a fully qualified Java class name for the cron job (see Adding Custom CP Crons for instructions on adding custom cron job classes);
  • disabled - if set to 1, the job is disabled; otherwise, it is enabled;
  • priority - if set, overrides the default group priority;
  • starttime - time when the job starts first. Format:
    • HH:MM - time in hours and minutes, for example, 5:15;
    • now - job starts immediately after CP start/restart;
    • now+HHhMMm - job starts in HH hours MM minutes after CP start/restart, for example, now+15m, now+2h, now+2h15m.
    If starttime is not set, the job won't start automatically.
  • period - sets the job launching period, in minutes; if not set, the job won't run;
  • maxinstancecount - maximum number of job instances running at a time.
  • threadcount - maximum number of threads running at a time in a multi-thread job.
  • db_mark - points to the job name in the H-Sphere database (value of the name field in the last_start table).
    See CP Crons in Sysadmin Guide for the last_start table description.

Related Docs:   Adding Custom CP Cron Jobs CP Cron Jobs Background Job Manager (Admin Guide) Cron Scripts

User comments
No comments for this page.
Sorry, adding new comments is temporary unavailable

Home   Products   Services   Partners   Support   News   Contact   Forum
© 2020 psoft.net.
All rights reserved.