Create cronjob for a web hosting package

A new cronjob for one web hosting package - a command, a URL or a PHP script, run on a schedule.

WWriteNot idempotentbetaNeeds service_webhosting
Tool
manitu_webhosting_web_cronjob_createon https://mcp.manitu.de/mcp
POST
/v1/webhosting/web/cronjob/createon https://api.manitu.de
Try it
Changes the account. Agents say what will happen and wait for an explicit yes before calling it.
readOnlyHint falsedestructiveHint falseidempotentHint falseopenWorldHint false

Creates a cronjob for a web hosting package of the manitu customer account this connection works in, by its site_id from manitu_webhosting_list: task (its type with command, url or script_path) and schedule, a cron expression in Europe/Berlin. Check runs_per_hour_max, count_max and php_version_list in manitu_webhosting_web_cronjob_list first. A command takes only letters, digits, space and _ - " ' . / : = + - no redirection, pipe, ; or &&: to keep the output, set report (reason, and type mail with mail.recipient, or logfile) instead. A run is stopped at runtime_seconds_max. Refused with a conflict when the package allows no more cronjobs (limit_reached) or cannot be changed now (not_configurable). It is active a few minutes later. Tell the customer what will run when and ask for an explicit yes first.

site_idinteger | stringrequired

The site_id from manitu_webhosting_list - never guess one.

pattern ^[1-9][0-9]*$min 1
taskobjectrequired

What it runs: type, and the one field that type uses. When the type changes, that field has to come along. In set, only the fields given change.

task.typestring

What it runs: command (a shell command, with command), url (calls a URL, with url), php_script (a PHP file of the package, with script_path).

One of command url php_script
task.commandstring

For type command: the command, run with bash as the package's user in its root directory. Only letters, digits, space and _ - " ' . / : = + - no redirection (> >> 2>), no pipe, nothing sent to the background, no ; or &&. For output use the report instead.

min length 1max length 1024
task.urlstring

For type url: the URL called (http or https) - reachable without login or IP restriction, answering with status 200.

min length 1max length 2048
task.script_pathstring

For type php_script: the PHP file, relative to the package, e.g. "/web/example.com/cron.php". It must exist.

min length 1max length 1024
task.php_versionstring | null

For type php_script: the PHP version, one of php_version_list from manitu_webhosting_web_cronjob_list (e.g. "php8.3"); null: the package's default.

max length 32
schedulestringrequired

When it runs, in Europe/Berlin: a cron expression - minute hour day-of-month month day-of-week, e.g. "30 3 * * *" (daily 3:30), "*/15 * * * *", "0 8-18 * * mon-fri" - or @hourly, @daily, @weekly, @monthly, @yearly. Not more often per hour than runs_per_hour_max of manitu_webhosting_web_cronjob_list allows.

min length 1max length 255
statusstring

active, or inactive to switch it off without deleting it. Default when created: active.

One of active inactive
descriptionstring | null

The customer's description - also $DESCRIPTION in the report mail. Left out: unchanged (set) or none (create); null or empty: none.

max length 1024
reportobject

Whom it tells about a run, and how. In set, only the fields given change.

report.reasonstring

When the customer is told about a run: never, onerror (exit code not 0), always. Default when created: never.

One of never onerror always
report.typestring

How: mail (needs mail.recipient), or logfile (a line in logs/cron.log of the package). Default when created: mail.

One of mail logfile
report.mailobject

The report mail - for type mail.

report.mail.recipientstring

Who gets the report mail.

max length 255
report.mail.subjectstring

The subject. Placeholders: $DESCRIPTION, $CMD_EXIT_CODE, $CMD_EXIT_STATUS, $CMD_OUTPUT_STDOUT, $CMD_OUTPUT_STDERR, $CMD_DURATION. Default when created: "[Cronjob] $DESCRIPTION: $CMD_EXIT_STATUS".

min length 1max length 255
report.mail.bodystring

The text, with the same placeholders. Default when created: exit code, duration and output (German).

min length 1max length 4096
cronjob_idintegerrequired

The cronjob - what the other cronjob tools take.

descriptionstring | nullrequired

What the customer wrote about it (his description), null if nothing - not its name or user name.

statusstringrequired

active, or inactive (switched off by the customer, kept for later).

One of active inactive
taskobjectrequired

What it runs - type, and only the field(s) that type uses.

task.typestring | nullrequired

command (a shell command), url (calls a URL), php_script (a PHP file of the package).

One of command url php_script null
task.commandstring | null

For type command: the shell command - runs as the package's user, in its root directory.

task.urlstring | null

For type url: the URL called.

task.script_pathstring | null

For type php_script: the PHP file, relative to the package.

task.php_versionstring | null

For type php_script: the PHP version (e.g. "php8.3"); null: the package's default.

schedulestring | nullrequired

When it runs - a cron expression (minute hour day-of-month month day-of-week), in Europe/Berlin. null only if what is stored cannot be read.

schedule_typestring | nullrequired

How the customer panel shows the schedule: minutely, hourly, daily, weekly, monthly, yearly, or crontab (anything else).

runs_per_hour_maxinteger | nullrequired

How often it runs in one hour at most.

next_run_atstring | nullrequired

When it runs next; null if inactive or never.

Format date-time
reportobjectrequired

Whom it tells about a run, and how.

report.reasonstring | nullrequired

When the customer is told about a run: never, onerror (exit code not 0), always.

One of never onerror always null
report.typestring | nullrequired

How: mail, or logfile (a line in logs/cron.log of the package).

One of mail logfile null
report.mailobject | nullrequired

The report mail - null unless type is mail.

report.mail.recipientstring | nullrequired

Who gets the report mail.

report.mail.subjectstring | nullrequired

Its subject, with placeholders.

report.mail.bodystring | nullrequired

Its text, with placeholders.

last_runobject | nullrequired

Its last run; null if it has not run yet.

last_run.exit_codeinteger | nullrequired

Its exit code - 0 is success, 127 "command not found"; a run stopped at the time limit often shows 9 or 137.

last_run.started_atstring | nullrequired

When it started.

Format date-time
last_run.ended_atstring | nullrequired

When it ended.

Format date-time
last_run.duration_secondsnumber | nullrequired

How long it ran.

created_atstring | nullrequired

When it was created.

Format date-time
run_listarray of objectrequired

Its last runs, newest first (at most 25) - with what it wrote.

run_list[].exit_codeinteger | nullrequired

Its exit code - 0 is success, 127 "command not found"; a run stopped at the time limit often shows 9 or 137.

run_list[].started_atstring | nullrequired

When it started.

Format date-time
run_list[].ended_atstring | nullrequired

When it ended.

Format date-time
run_list[].duration_secondsnumber | nullrequired

How long it ran.

run_list[].stdoutstring | nullrequired

What it wrote to standard output - the first 1024 characters.

run_list[].stderrstring | nullrequired

What it wrote to standard error - the first 1024 characters.

One of X-API-Key, Authorization: Bearer … - never more than one in a request. More

site_idinteger | stringrequired

The site_id from manitu_webhosting_list - never guess one.

pattern ^[1-9][0-9]*$min 1
taskobjectrequired

What it runs: type, and the one field that type uses. When the type changes, that field has to come along. In set, only the fields given change.

task.typestring

What it runs: command (a shell command, with command), url (calls a URL, with url), php_script (a PHP file of the package, with script_path).

One of command url php_script
task.commandstring

For type command: the command, run with bash as the package's user in its root directory. Only letters, digits, space and _ - " ' . / : = + - no redirection (> >> 2>), no pipe, nothing sent to the background, no ; or &&. For output use the report instead.

min length 1max length 1024
task.urlstring

For type url: the URL called (http or https) - reachable without login or IP restriction, answering with status 200.

min length 1max length 2048
task.script_pathstring

For type php_script: the PHP file, relative to the package, e.g. "/web/example.com/cron.php". It must exist.

min length 1max length 1024
task.php_versionstring | null

For type php_script: the PHP version, one of php_version_list from manitu_webhosting_web_cronjob_list (e.g. "php8.3"); null: the package's default.

max length 32
schedulestringrequired

When it runs, in Europe/Berlin: a cron expression - minute hour day-of-month month day-of-week, e.g. "30 3 * * *" (daily 3:30), "*/15 * * * *", "0 8-18 * * mon-fri" - or @hourly, @daily, @weekly, @monthly, @yearly. Not more often per hour than runs_per_hour_max of manitu_webhosting_web_cronjob_list allows.

min length 1max length 255
statusstring

active, or inactive to switch it off without deleting it. Default when created: active.

One of active inactive
descriptionstring | null

The customer's description - also $DESCRIPTION in the report mail. Left out: unchanged (set) or none (create); null or empty: none.

max length 1024
reportobject

Whom it tells about a run, and how. In set, only the fields given change.

report.reasonstring

When the customer is told about a run: never, onerror (exit code not 0), always. Default when created: never.

One of never onerror always
report.typestring

How: mail (needs mail.recipient), or logfile (a line in logs/cron.log of the package). Default when created: mail.

One of mail logfile
report.mailobject

The report mail - for type mail.

report.mail.recipientstring

Who gets the report mail.

max length 255
report.mail.subjectstring

The subject. Placeholders: $DESCRIPTION, $CMD_EXIT_CODE, $CMD_EXIT_STATUS, $CMD_OUTPUT_STDOUT, $CMD_OUTPUT_STDERR, $CMD_DURATION. Default when created: "[Cronjob] $DESCRIPTION: $CMD_EXIT_STATUS".

min length 1max length 255
report.mail.bodystring

The text, with the same placeholders. Default when created: exit code, duration and output (German).

min length 1max length 4096
cronjob_idintegerrequired

The cronjob - what the other cronjob tools take.

descriptionstring | nullrequired

What the customer wrote about it (his description), null if nothing - not its name or user name.

statusstringrequired

active, or inactive (switched off by the customer, kept for later).

One of active inactive
taskobjectrequired

What it runs - type, and only the field(s) that type uses.

task.typestring | nullrequired

command (a shell command), url (calls a URL), php_script (a PHP file of the package).

One of command url php_script null
task.commandstring | null

For type command: the shell command - runs as the package's user, in its root directory.

task.urlstring | null

For type url: the URL called.

task.script_pathstring | null

For type php_script: the PHP file, relative to the package.

task.php_versionstring | null

For type php_script: the PHP version (e.g. "php8.3"); null: the package's default.

schedulestring | nullrequired

When it runs - a cron expression (minute hour day-of-month month day-of-week), in Europe/Berlin. null only if what is stored cannot be read.

schedule_typestring | nullrequired

How the customer panel shows the schedule: minutely, hourly, daily, weekly, monthly, yearly, or crontab (anything else).

runs_per_hour_maxinteger | nullrequired

How often it runs in one hour at most.

next_run_atstring | nullrequired

When it runs next; null if inactive or never.

Format date-time
reportobjectrequired

Whom it tells about a run, and how.

report.reasonstring | nullrequired

When the customer is told about a run: never, onerror (exit code not 0), always.

One of never onerror always null
report.typestring | nullrequired

How: mail, or logfile (a line in logs/cron.log of the package).

One of mail logfile null
report.mailobject | nullrequired

The report mail - null unless type is mail.

report.mail.recipientstring | nullrequired

Who gets the report mail.

report.mail.subjectstring | nullrequired

Its subject, with placeholders.

report.mail.bodystring | nullrequired

Its text, with placeholders.

last_runobject | nullrequired

Its last run; null if it has not run yet.

last_run.exit_codeinteger | nullrequired

Its exit code - 0 is success, 127 "command not found"; a run stopped at the time limit often shows 9 or 137.

last_run.started_atstring | nullrequired

When it started.

Format date-time
last_run.ended_atstring | nullrequired

When it ended.

Format date-time
last_run.duration_secondsnumber | nullrequired

How long it ran.

created_atstring | nullrequired

When it was created.

Format date-time
run_listarray of objectrequired

Its last runs, newest first (at most 25) - with what it wrote.

run_list[].exit_codeinteger | nullrequired

Its exit code - 0 is success, 127 "command not found"; a run stopped at the time limit often shows 9 or 137.

run_list[].started_atstring | nullrequired

When it started.

Format date-time
run_list[].ended_atstring | nullrequired

When it ended.

Format date-time
run_list[].duration_secondsnumber | nullrequired

How long it ran.

run_list[].stdoutstring | nullrequired

What it wrote to standard output - the first 1024 characters.

run_list[].stderrstring | nullrequired

What it wrote to standard error - the first 1024 characters.

200Success.400The request does not match the declared input schema.401No credential was presented, or it was not recognised.403The credential is not permitted to use this operation.500The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.503The channel this operation forwards through is unavailable.