• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Resolved API change Cronjobs with CLI (cli/crontab_shell/call)

Giu

Basic Pleskian
Server operating system version
Debian 12.4
Plesk version and microupdate number
18.0.58
Hello Forum,

i want to know how can i set and get cronjobs via api xml or json.

i thought about using /api/v2cli/crontab_shell/call

the command reference for this is:
{
"allowed_commands": {
"update": {
"name": "update",
"info": "Updates crontab shell at domain",
"param": {
"required": true,
"usage": "<domain_name>"
}
},
"help": {
"name": "help",
"info": "Displays this help page."
}
},
"allowed_options": {}
}

so not much info here.

the Help output is:
Usage: crontab_shell command <domain-name> [options]\n\n Available commands:\n --update or -u <domain_name> Updates crontab shell at domain\n --help or -h Displays this help page.\n\n\nVersion: 18.0.58_build1800240123.15 os_Debian 12.0

can anyone help me get started on how to use this?

{
"params": [
"--update",
"mydomain.com",
"..... what are the options?"
]
}
 
There is no method for listing or adding cronjobs in the API's or in the Plesk CLI. Cronjobs can be managed directly via the crontab system command in Linux.
 
  • Like
Reactions: Giu
And to add to this, you can also create and modify files in /var/spool/cron directly (if the user has sufficient permissions).
 
  • Like
Reactions: Giu
thanks @Kaspar and @Peter Debik
but what is the endpoint "/api/v2cli/crontab_shell/call" then for?
It's an undocumented utility. But if I had to take a guess, I would say it probably has something todo with updating the specific shell for running cron jobs. It can't be used to manage crontab itself.
 
  • Like
Reactions: Giu
Back
Top