\GSPPanel\Cron
This class allows interaction with scheduled tasks
Methods
Add(array $params) : array
Adds a scheduled task
$params requires the following:
- time: The cron time the task should run at(REQUIRED)
- type: The type of task to run(REQUIRED)
- syscontrolid: If the type is a syscontrol, you need to specify the syscontrol id
- ugid: If the type is restart, start, or stop, you need to specify the ugid
Returns one of the following in an array format:
- error
- -1 - No or invalid time
- -2 - No type
- -3 - No syscontrol id specified
- -4 - No ugid specified
- -5 - Server Monitor can only be added once
- -6 - The scheduler method needs to be set to GSP-Panel
- 0 - Added successfully
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
array |
ListJobs(array $params) : array
Lists scheduled tasks
$params requires the following:
- type: The type of task to run
- syscontrolid: If the type is a syscontrol, you need to specify the syscontrol id
- ugid: If the type is restart, start, or stop, you need to specify the ugid
Returns one of the following in an array format:
- error
- -1 - The scheduler method needs to be set to GSP-Panel
- 0 - List successfully
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
array |
Remove(integer $cronid) : array
Removes a scheduled task
Returns one of the following in an array format:
- error
- -1 - No cronid or invalid cronid
- -2 - The scheduler method needs to be set to GSP-Panel
- 0 - Removed successfully
Name | Type | Description |
---|---|---|
$cronid | integer |
Type | Description |
---|---|
array |