3.3 KiB
mc watch
minio
Table of Contents
mc watch
Syntax
The mc watch command
watches for events on the specified MinIO 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.
EXAMPLE
The following command watches for events <mc-event-supported-events> on any object
or prefix in the mydata bucket on the myminio
MinIO deployment:
mc watch --recursive myminio/mydata
SYNTAX
The command has the following syntax:
mc [GLOBALFLAGS] watch \
[--event "string"] \
[--prefix "string"] \
[--recursive] \
[--suffix "string"] \
ALIAS
Parameters
ALIAS
Required The alias <alias> of a MinIO deployment and the full
path to the bucket to watch for configured events. For example:
mc tree myminio/mybucket
event
The event(s) to watch for. Specify multiple events using a comma
, delimiter. See mc-event-supported-events for supported events.
Defaults to put,delete, get.
prefix
The bucket prefix in which to watch for the specified ~mc watch event.
For example, given a ~mc watch ALIAS of play/mybucket and a
~mc watch prefix of photos,
only events in play/mybucket/photos trigger bucket
notifications.
recursive, r
Recursively watch for events in the specified ~mc watch ALIAS bucket
path or local directory.
suffix
The bucket suffix in which to watch for the specified ~mc watch event.
For example, given a ~mc watch ALIAS of play/mybucket and a
~mc watch suffix of .jpg, only
events in play/mybucket/*.jpg trigger bucket
notifications.
Global Flags
Examples
Watch for Events in a Bucket
mc watch --recursive ALIAS/PATH
- Replace
ALIAS <mc watch ALIAS>with thealias <mc alias>of the S3-compatible host. - Replace
PATH <mc watch ALIAS>with the path to the bucket.