Controller: Cron

API Controller /siteworx/cron
Required Permissions ["CRONTAB"]
Required Options Crontab Access
Action Description
add Add a new cronjob to the user's crontab.
delete Delete cronjobs from the SiteWorx user's crontab.
edit Edit an existing cronjob in the user's crontab.
list List cron jobs.
options Edit cron options.

Action: add

Add a new cronjob to the user's crontab.

Input Parameters

Name Type Notes Required?
minute struct (string)
Example Values
*, */2, */5, */10, */15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, ...
Example Default Value
["*"]
No*
hour struct (string)
Example Values
*, */2, */4, */6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
Example Default Value
["*"]
No*
day struct (string)
Example Values
*, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
Example Default Value
["*"]
No*
month struct (string)
Example Values
*, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Example Default Value
["*"]
No*
dayofweek struct (string)
Example Values
*, 0, 1, 2, 3, 4, 5, 6
Example Default Value
["*"]
No*
script string Yes
* indicates that it's actually required, but probably already has a valid default value

Action: delete

Delete cronjobs from the SiteWorx user's crontab.

Input Parameters

Name Type Notes Required?
jobs struct (integer)
Example Values
1
Yes

Action: edit

Edit an existing cronjob in the user's crontab.

Input Parameters

Name Type Notes Required?
job integer
Example Values
1
Yes
minute string
Example Default Value
59
No*
hour string
Example Default Value
23
No*
day string
Example Default Value
31
No*
month string
Example Default Value
12
No*
dayofweek string
Example Default Value
6
No*
script string
Example Default Value
echo test
No*
* indicates that it's actually required, but probably already has a valid default value

Action: list

List cron jobs.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    1 => 
    array (
      'type' => 'normal',
      'linenum' => 1,
      'minute' => '59',
      'hour' => '23',
      'day' => '31',
      'month' => '12',
      'dayofweek' => '6',
      'script' => 'echo test',
    ),
  ),
)

Action: options

Edit cron options.

Input Parameters

Name Type Notes Required?
shell string
Help Entry
Use the dropdown to choose the shell to run the cron job on.
Example Values
/bin/sh, /bin/bash, /sbin/nologin, /bin/tcsh, /bin/csh, /bin/ksh
No*
path struct (string)
Help Entry
The path contains the directories which will be in the search path for cron.
Example Default Value
["\/usr\/kerberos\/bin","\/usr\/local\/bin","\/bin","\/usr\/bin","\/home\/interworx\/bin"]
No
mailto string
Help Entry
Enter an email address to be notified of the output of each cron job.
No
* indicates that it's actually required, but probably already has a valid default value