From d9603af08ad4b2e1fbe8483d3d02f4a5850acb51 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 10 Nov 2025 01:55:44 -0500 Subject: [PATCH] docs: document cron task suspension --- docs/processes/scheduled-cron-tasks.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/processes/scheduled-cron-tasks.md b/docs/processes/scheduled-cron-tasks.md index a8d39fdfc..39f659586 100644 --- a/docs/processes/scheduled-cron-tasks.md +++ b/docs/processes/scheduled-cron-tasks.md @@ -6,8 +6,10 @@ ``` cron:list [--format json|stdout] # List scheduled cron tasks for an app cron:report [] [] # Display report about an app +cron:resume # Resume a cron task cron:run [--detach] # Run a cron task on the fly cron:set [--global|] # Set or clear a cron property for an app +cron:suspend # Suspend a cron task ``` ## Usage @@ -124,6 +126,26 @@ ID Schedule Command 5cruaotm4yzzpnjlsdunblj8qyjp @daily /bin/true ``` +#### Suspending and resuming a specific cron task + +Cron tasks can be suspended to temporarily prevent them from running, and later resumed to re-enable them. This is useful for maintenance or debugging purposes. + +To suspend a specific cron task, use the `cron:suspend` command with the app name and cron ID: + +```shell +dokku cron:suspend node-js-app cGhwPT09cGhwIHRlc3QucGhwPT09QGRhaWx5 +``` + +A suspended task will not execute according to its schedule. You can verify a task is suspended by checking the `Maintenance` column in the `cron:list` output, which will show `true (task)` for suspended tasks. + +To resume a suspended cron task, use the `cron:resume` command: + +```shell +dokku cron:resume node-js-app cGhwPT09cGhwIHRlc3QucGhwPT09QGRhaWx5 +``` + +Once resumed, the task will execute according to its schedule again. The cron ID can be retrieved from the `cron:list` output. + #### Executing a cron task on the fly Cron tasks can be invoked via the `cron:run` command. This command takes an `app` argument and a `cron id` (retrievable from `cron:list` output).