Chapter 61: Controller: /siteworx/backup/schedule Up Part III: SiteWorx API Spec Chapter 63: Controller: /siteworx/dns 

62 Controller: /siteworx/cron

Required Permissions "CRONTAB"
Required Options Crontab Access
Action: add
Added in version 4.7.0-339
Description 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: edit
Added in version 4.7.0-339
Description Edit an existing cronjob in the user’s crontab.
Input Parameters
Name Type Notes Required?
job integer Yes
enabled integer Example Values
1, 0
Example Default Value
1
No*
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
Added in version 4.7.0-339
Description List cron jobs.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
0 =>
array (
’type’ => ’normal’,
’enabled’ => 1,
’linenum’ => 0,
’minute’ => ’59’,
’hour’ => ’23’,
’day’ => ’31’,
’month’ => ’12’,
’dayofweek’ => ’6’,
’script’ => ’echo test’,
),
),
)
Action: options
Added in version 4.7.0-339
Description 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/dash, /usr/sbin/jk_chrootsh
No*
path struct (string) Help Entry
The path contains the directories which will be in the search path for cron.
Example Default Value
["\/usr\/local\/bin","\/bin","\/usr\/bin","\/usr\/local\/sbin","\/usr\/sbin","\/sbin","\/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
Action: queryEdit
Added in version 5.1.0-838
Description Displays the information available to the action "edit".
Input Parameters
Name Type Notes Required?
job integer Yes
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’systemtime’ => ’Tue, 10 Oct 17 04:38:26 -0400’,
’enabled’ => ’1’,
’minute’ => ’59’,
’hour’ => ’23’,
’day’ => ’31’,
’month’ => ’12’,
’dayofweek’ => ’6’,
’script’ => ’echo test’,
’job’ => ’0’,
),
)
Action: queryJobs
Added in version 4.8.0-393
Description List user jobs.
Action: queryOptions
Added in version 4.8.0-393
Description Displays the information available to the action "options".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
0 =>
array (
’user’ => ’example’,
’shell’ => ’’,
’path’ => ’/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/interworx/bin’,
’mailto’ => ’’,
),
),
)
 Chapter 61: Controller: /siteworx/backup/schedule Up Part III: SiteWorx API Spec Chapter 63: Controller: /siteworx/dns 

(C) 2017 by InterWorx LLC