Self Help Documentation
< All Topics

tool/editcron

Description

Edits an existing cron job in a given SPanel account.

Info
Have a look at the tool/createcron article as the cron syntax and parameters values/combinations are explained in depth there. Both API calls share the same syntax.

Parameters

FieldTypeRequiredDescription
tokenstringYesAuthorizing API token – check API Basics for more information.
accountuserstringYesThe SPanel user account that is being managed or viewed.
actionstringYesThe category and function being executed.
minutearrayYesThe old and new minute parameter.
hourarrayYesThe old and new hour parameter.
dayarrayYesThe old and new day parameter.
montharrayYesThe old and new month parameter.
weekdayarrayYesThe old and new weekday parameter.
commandarrayYesThe old and new command parameter.

Info
You may have already noticed that most of the parameters above are listed with an array type.

When editing an existing cron job, these parameters must include old and new value as shown in the example even if there is no change to the corresponding parameter.

Example

You can find more information about the Endpoint URL in our API Basics article.

In the example above, the only changed parameter is “minute”. Every other parameter is passed the same as in the existing cron job. The API call will result in no changes for the existing cron job except for the “minute” parameter. It will be changed from “*” (execution every minute) to “*/5” (execution every 5 minutes).

Output

Table of Contents