mc inventory cancel

mc inventory cancel cancels a running inventory job.

The behavior of cancelling a job depends on the schedule of the job:

  • once: The job never runs again after cancellation.
  • All other values: The job runs at the next scheduled time.

To fully stop a periodic job, either suspend or delete it:

This command requires the admin:InventoryControl permission.

Syntax

Parameters

TARGET/BUCKET

Required

The full path to the bucket containing the inventory configuration. Specify both the alias and bucket name in the format ALIAS/BUCKET.

For example:

mc inventory cancel myaistor/mybucket weekly-report

INVENTORY-ID

Required

The unique identifier of the inventory job to cancel.

For example, the following command cancels the job with ID monthly-inventory at the myaistor/mybucket path:

mc inventory cancel myaistor/mybucket monthly-inventory

Global flags

This command supports any of the global flags.

Examples

Cancel a running job

The following command cancels a running inventory job with ID onetime-inventory at the myaistor/mybucket path:

mc inventory cancel myaistor/mybucket onetime-inventory
  • Replace myaistor with the alias of your AIStor deployment.
  • Replace mybucket with the name of the bucket.
  • Replace job-id with the inventory configuration ID.

S3 compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported.

While mc commands may work as documented, any such usage is at your own risk.

Permissions

The user or service account running this command must have the admin:InventoryControl permission.

For more information on AIStor policies and permissions, see Access Management.

Behavior

Cancellation detection

Running jobs check for control operations approximately every 10 seconds. After you issue a cancel command, the running job detects the cancellation within approximately 10 seconds and stops.

Output files

Canceling a job stops it mid-execution. Any output files already written to the destination bucket remain. The manifest file may indicate a canceled or incomplete status.

Canceling non-running jobs

You can only cancel jobs that are currently in the Running or Pending state. Attempting to cancel a job in other states (Sleeping, Completed, Suspended) may result in an error.

Comparison with mc inventory suspend

The mc inventory cancel command stops the current execution only. Periodic jobs automatically resume at the next scheduled time.

The mc inventory suspend command stops the current execution AND prevents all future scheduled runs.

Use cancel for one-time interruptions and suspend for longer-term pauses.