Skip to main content

mr job cancel

Stop a job that has not finished. <id> is the Job id jobs list prints, or the legacy handle job submit returns as id. Cancel works while the Job is queued, running, or paused; the server rejects cancellation of a Job that has already succeeded, failed, or been cancelled, answering HTTP 409 Conflict. On success the Job is recorded as cancelled and stays readable through jobs get for inspection.

Use jobs list --command cancel to see which Jobs currently offer cancellation.

Usage​

mr job cancel <id>

Positional arguments:

  • <id>

Examples​

Cancel a specific Job

mr job cancel 018f4db1-9b40-7f54-8f16-37a449bcf01d

Cancel every visible Job that currently offers cancellation

mr jobs list --command cancel --json | jq -r '.jobs[].id' | xargs -I {} mr job cancel {}

Flags​

This command has no local flags.

Inherited global flags​

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output​

Object with status set to "cancelled" and canonicalJobId naming the cancelled Job

Exit Codes​

0 on success; 1 on any error

See Also​