Cron

API Documentation

\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
Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
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
Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
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
Parameters
NameTypeDescription
$cronidinteger
Returns
TypeDescription
array
Documentation was generated by phpDocumentor 2.9.0.