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

Required?

Example Values

Default Values

Notes

minute

struct (string)

No*

*, */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, …

[“*”]

hour

struct (string)

No*

*, */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

[“*”]

day

struct (string)

No*

*, 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

[“*”]

month

struct (string)

No*

*, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12

[“*”]

dayofweek

struct (string)

No*

*, 0, 1, 2, 3, 4, 5, 6

[“*”]

script

string

Yes

* indicates that it’s actually required, but probably already has a valid default value.

Action: delete

Added in Version

4.7.0-339

Description

Delete cronjobs from the SiteWorx user’s crontab.

Input Parameters

Name

Type

Required?

Example Values

Default Values

Notes

jobs

struct (integer)

Yes

2

Action: edit

Added in Version

4.7.0-339

Description

Edit an existing cronjob in the user’s crontab.

Input Parameters

Name

Type

Required?

Example Values

Default Values

Notes

job

integer

Yes

2

enabled

integer

No*

1, 0

1

minute

string

No*

59

hour

string

No*

23

day

string

No*

31

month

string

No*

12

dayofweek

string

No*

6

script

string

No*

echo test

* indicates that it’s actually required, but probably already has a valid default value.

Action: fail

Added in Version

n/a

Description

Magic function - test for failure mechanism.

Action: getCurrentSystemTime

Added in Version

6.1.19-1483

Description

Get current system time in RFC822 format.

Action: list

Added in Version

4.7.0-339

Description

List cron jobs.

Sample Output

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

Action: options

Added in Version

4.7.0-339

Description

Edit cron options.

Input Parameters

Name

Type

Required?

Example Values

Default Values

Notes

shell

string

No*

/bin/sh, /bin/bash, /usr/bin/sh, /usr/bin/bash, /bin/zsh, /sbin/nologin

Use the dropdown to choose the shell to run the cron job on.

path

struct (string)

No

[“/usr/local/bin”,”/usr/bin”]

The path contains the directories which will be in the search path for cron.

mailto

string

No

Enter an email address to be notified of the output of each cron job.

* 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

Required?

Example Values

Default Values

Notes

job

integer

Yes

2

Sample Output

array (
  'status' => 0,
  'payload' =>
  array (
    'systemtime' => 'Sun, 12 Jan 20 00:51:13 -0400',
    'enabled' => '1',
    'minute' => '59',
    'hour' => '23',
    'day' => '31',
    'month' => '12',
    'dayofweek' => '6',
    'script' => 'echo test',
    'job' => '2',
  ),
  'reply_code' => 205,
)

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:/usr/bin',
      'mailto' => '',
    ),
  ),
  'reply_code' => 205,
)

Action: reroute

Added in Version

n/a

Description

Action to re-route from the current controller to a different one.

Action: win

Added in Version

n/a

Description

Magic function - test for testing success mechanism.