Cron
4 functions, invoked through the cpanel_uapi tool.
List, add, edit or remove the account's cron jobs
cpanel_uapi(service_id, module="Cron", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.add_line POST mutating#
Add a cron job
This function adds a cron job to the account's crontab.
JetHost note: command must be a single line (cPanel rejects newlines); escape a literal % as \% because crontab treats an unescaped % as a newline; an invalid schedule is rejected when the crontab is installed. There is no MAILTO support — redirect output inside the command to avoid cron mail. The response carries the new job's linekey.
edit_line POST mutating#
Edit a cron job
This function replaces an existing cron job's schedule and command.
JetHost note: the job's linekey CHANGES on edit — use the new linekey from the response, or call fetchcron again, before a further edit_line or remove_line. The same command rules as add_line apply (single line, \%, no MAILTO).
fetchcron GET#
List cron jobs
This function returns the account's crontab as rows. Only rows with type command are jobs (linekey, minute, hour, day, month, weekday, command); rows with type variable are crontab variables such as MAILTO or SHELL.
JetHost note: linekey identifies a job for edit_line / remove_line and changes whenever the job is edited.
No parameters.
remove_line POST mutating#
Remove a cron job
This function removes a cron job from the account's crontab.
JetHost note: if the linekey came from an older listing it may be stale (every edit changes it); confirm the removal with fetchcron.