• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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