Description
This function edits a crontab entry.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Important:
You must specify either the commandlinenumber
or the linekey
parameter.
Parameter |
Type |
Description |
Possible values |
Example |
commandlinenumber |
integer |
The line of the cron entry to edit. Note: Use the cPanel API 2Cron::listcronfunction to determine the correct line. |
Any positive integer. |
2 |
linekey |
string |
The linekey of the cron entry to edit. Note: Use the cPanel API 2Cron::listcronfunction to determine the correct linekey. |
A valid string. |
c5e242023f60e1bd37110687338e9e8d |
weekday |
string |
Required The day of the week on which the cron job runs. |
|
0 |
minute |
string |
Required The minute of the hour on which the cron job runs. |
An integer between 0 and 59.
|
0 |
hour |
string |
Required The hour of the day on which the cron job runs. |
An integer between 0 and 23.
|
1 |
day |
string |
Required The day of the month on which the cron job runs. |
An integer between 1 and 31.
|
1 |
month |
string |
Required The month of the year on which the cron job runs. |
An integer between 1 and 12.
|
1 |
command |
string |
Required The command to run. |
A valid string. |
/usr/bin/perl/home/username/happynewyear.pl |
Returns
Return |
Type |
Description |
Possible values |
Example |
linekey |
string |
A unique ID for the line in the crontab file. |
A random string. |
c5e242023f60e1bd37110687338e9e8d |
statusmsg |
string |
The status of the crontab file |
A valid string. |
crontab installed |
status |
Boolean |
The status of the function. |
|
1 |
reason |
string |
A reason for failure. Note: This function only returns a reason value if it failed. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |