Description

This function removes a crontab entry.

Examples 


https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Cron&cpanel_jsonapi_func=remove_line&line=2

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Remove the crontab line "2"
$hotel_california = $cpanel->api2(
    'Cron', 'remove_line',
 array(
        'line'        => '2',
    ) 
);

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Remove the crontab line "2"
my $hotel_california = $cpliveapi->api2(
    'Cron', 'remove_line',    { 
        'line'        => '2',
    }
);

cpapi2 --user=username Cron remove_line line=2

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "remove_line",
    "data": [
      {
        "statusmsg": "crontab installed",
        "status": 1
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Cron"
  }
}

Parameters

ParameterTypeDescriptionPossible valuesExample
lineinteger

Required

The line in the crontab file to remove.

A positive integer.2

Returns

ReturnTypeDescriptionPossible valuesExample
statusmsgstringThe crontab file's status.A valid string.
crontab installed
statusBooleanThe function call's status.
  • 1 — The function succeeded.
  • 0 — The function failed.
1
reasonstring

A reason for failure.

This function only returns a reason value if it failed.

A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1