app:scheduler:pause
Pause a scheduled job, so it stops running on its schedule until it is resumed. The command does what Pause on the admin Scheduler page and POST /api/admin/scheduler/jobs/{id}/pause do.
Quick start
make exec cmd="php bin/console app:scheduler:pause aB3dE5fG7hJ9kL1mN3pQr"
Print the result as JSON, for a script:
make exec cmd="php bin/console app:scheduler:pause aB3dE5fG7hJ9kL1mN3pQr --json"
Arguments
| Argument | Required | Description |
|---|---|---|
id |
Yes | Public ID of the scheduled job, as app:scheduler:list prints it |
Options
| Option | Description |
|---|---|
--json |
Print only the result, as the admin API's data payload, in JSON |
Details
Pausing an active job sets its status to paused. Pausing a job that is already paused succeeds without changing it, so a retry is harmless. A disabled job cannot be paused: the command fails with A disabled job cannot be paused. Enable it first., the conflict the API reports as 409.
Resume the job with app:scheduler:resume.
With --json the command prints only the job as the API's data object, the same fields app:scheduler:show --json prints, with its new status.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Job paused, or it was already paused |
| 1 | No scheduled job has this public ID, the job is disabled, or it changed concurrently; the message says why |
| 2 | The argument is not a public ID |