mc watch

The mc watch command watches for events on the specified AIStor bucket or local filesystem path. For S3 services, use mc event add to configure bucket event notifications on S3-compatible services.

You can also use mc watch against a local filesystem directory to produce similar results to running the inotify -e modify,create,delete,move command.

Syntax

Parameters

ALIAS

Required The alias of a AIStor deployment and the full path to the bucket to watch for configuredevents. For example:

mc watch myminio/mybucket

--event

The event(s) to watchfor. Specify multiple events using a comma , delimiter. See Supported Bucket Events for supported events.

Defaults to put,delete, get.

--prefix

The bucket prefix in which to watch for the specified --event.

For example, given a ALIAS of play/mybucket and a --prefix of photos, only events in play/mybucket/photos trigger bucket notifications.

--recursive

Alias: -r

Recursively watch for events in the specified ALIAS bucket path or local directory.

--suffix

The bucket suffix in which to watch for the specified --event.

For example, given a ALIAS of play/mybucket and a --suffix of .jpg, only events in play/mybucket/*.jpg trigger bucket notifications.

Global Flags

--json

Optional

Enables JSON lines formatted output to the console.

For example:

mc --json COMMAND

Examples

Watch for Events in a Bucket

mc watch --recursive ALIAS/PATH
  • Replace ALIAS with the alias of the S3-compatible host.
  • Replace PATH with the path to the bucket.

Behavior

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.

AIStor 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.