1
0
mirror of https://github.com/minio/docs.git synced 2025-07-30 07:03:26 +03:00

DOCS-380: Refactor CLI reference

This commit is contained in:
ravindk89
2021-12-16 14:19:49 -05:00
committed by Ravind Kumar
parent 0d3be1d74f
commit ef30821063
127 changed files with 10929 additions and 6960 deletions

View File

@ -0,0 +1,123 @@
.. _minio-mc-alias-list:
=================
``mc alias list``
=================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc alias list
Syntax
------
.. start-mc-alias-list-desc
The :mc:`mc alias list` command lists all aliases in the local
:program:`mc` configuration.
.. end-mc-alias-list-desc
The command output includes the configured access key and secret key associated
to each alias.
.. tab-set::
.. tab-item:: EXAMPLE
The following command lists all :ref:`aliases <alias>` configured
on the local host machine:
.. code-block:: shell
:class: copyable
mc alias list
.. tab-item:: SYNTAX
The :mc-cmd:`mc alias list` command has the following syntax:
.. code-block:: shell
mc [GLOBALFLAGS] alias list [ALIAS]
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Optional* The name of a specific alias to display.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List All Configured Aliases
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
The following :mc-cmd:`mc alias list` command lists all configured aliases
in the local :program:`mc` configuration.
.. code-block:: shell
:class: copyable
mc alias list
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc alias list
List a Specific Alias
~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
The following :mc-cmd:`mc alias list` command lists the details of a
specific alias in the local :program:`mc` configuration.
.. code-block:: shell
:class: copyable
mc alias list myminio
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc alias list ALIAS
- Replace ``ALIAS`` with the the name of the alias to return.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,101 @@
.. _minio-mc-alias-remove:
===================
``mc alias remove``
===================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc alias remove
Syntax
------
.. start-mc-alias-remove-desc
The :mc:`mc alias remove` removes an existing alias from the local
:program:`mc` configuration.
.. end-mc-alias-remove-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes the ``myminio`` :ref:`alias <alias>` for a
MinIO deployment from the host machine:
.. code-block:: shell
:class: copyable
mc alias remove myminio
.. tab-item:: SYNTAX
The :mc-cmd:`mc alias remove` command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] alias remove ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The alias to remove from the local :program:`mc` configuration.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Remove an Alias from the ``mc`` Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc alias remove` to remove an existing alias from the
:program:`mc` configuration:
.. tab-set::
.. tab-item:: Example
The following command removes the ``myminio`` alias.
.. code-block:: shell
:class: copyable
mc alias remove myminio
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc alias remove ALIAS
Replace ``ALIAS`` with the the name of the alias to remove.
Behavior
~~~~~~~~
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,202 @@
.. _minio-mc-alias-set:
.. _minio-mc-alias:
.. _alias:
================
``mc alias set``
================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc alias
.. mc:: mc alias set
.. |command| replace:: :mc-cmd:`mc alias set`
Syntax
------
.. start-mc-alias-set-desc
The :mc:`mc alias set` command adds or updates an alias to the local
:program:`mc` configuration.
.. end-mc-alias-set-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command adds an :ref:`alias <alias>` for a MinIO
deployment ``myminio`` running at the URL
``https://myminio.example.net``. :program:`mc` uses the specified
username and password for authenticating to the MinIO deployment:
.. code-block:: shell
:class: copyable
mc alias set myminio https://myminio.example.net minioadminuser minioadminpassword
If the ``myminio`` alias already exists, the command overwrites that
alias with the new URL, access key, and secret key.
.. tab-item:: SYNTAX
The :mc-cmd:`mc alias set` command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] alias set \
[--api "string"] \
[--path "string"] \
ALIAS \
URL \
ACCESSKEY \
SECRETKEY
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The name to associate to the S3-compatible service.
.. mc-cmd:: URL
*Required* The URL to the S3-compatible service endpoint. For example:
``https://minio.example.net``
.. mc-cmd:: ACCESSKEY
*Required*
The access key for authenticating to the S3 service.
.. mc-cmd:: SECRETKEY
*Required*
The secret key for authenticating to the S3 service.
.. mc-cmd:: api
:option:
*Optional*
Specifies the signature calculation method to use when connecting to the
S3-compatible service. Supports the following values:
- ``S3v4`` (Default)
- ``S3v2``
.. note::
AWS Signature V2 is considered
`deprecated <https://aws.amazon.com/blogs/aws/amazon-s3-update-sigv2-deprecation-period-extended-modified/>`__
by AWS. :mc-cmd:`mc alias set` includes this option only for S3 buckets
or services still reliant on the Signature V2.
Use ``S3v4`` unless explicitly required by the S3-compatible service.
MinIO server does not rely on nor require ``S3v2``, nor are all API
operations available on ``S3v2``.
.. mc-cmd:: path
:option:
*Optional*
Specifies the bucket path lookup setting used by the server. Supports the
following values:
- ``"auto"`` (Default)
- ``"on"``
- ``"off"``
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Add or Update an Alias for a MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc alias set` to add an S3-compatible service for use with
:program:`mc`:
.. tab-set::
.. tab-item:: Example
The following command creates a new alias ``myminio`` pointing at a
MinIO deployment at ``https://minio.example.net``. The
alias uses the ``miniouser`` and ``miniopassword`` credentials for
performing operations against the deployment.
.. code-block:: shell
:class: copyable
mc alias set myminio https://minio.example.net miniouser miniopassword
If the ``myminio`` alias already exists, the
:mc-cmd:`mc alias set` command overwrites that alias with the specified
arguments.
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc alias set ALIAS HOSTNAME ACCESSKEY SECRETKEY
- Replace ``ALIAS`` with the the name to associate to the
MinIO service.
- Replace ``HOSTNAME`` with the URL for any node in the MinIO
deployment. You can alternatively specify the URL for a load balancer
or reverse proxy managing connections to the MinIO deployment.
- Replace ``ACCESSKEY`` and ``SECRETKEY`` with credentials for a user
on the MinIO deployment.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility
Required Credentials and Access Control
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:mc-cmd:`mc alias set` requires specifying an access key and corresponding
secret key for the S3-compatible host. :program:`mc` functionality is limited
based on the policies associated to the specified credentials. For example, if
the specified credentials do not have read/write access to a specific bucket,
:program:`mc` cannot perform read or write operations on that bucket.
For more information on MinIO Access Control, see
:ref:`minio-access-management`.
For more complete documentation on S3 Access Control, see
:s3-docs:`Amazon S3 Security <security.html>`.
For all other S3-compatible services, defer to the documentation for that
service.

View File

@ -0,0 +1,192 @@
.. _minio-mc-cat:
==========
``mc cat``
==========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc cat
.. Replacement substitutions
.. |command| replace:: :mc-cmd:`mc cat`
.. |rewind| replace:: :mc-cmd-option:`~mc cat rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc cat version-id`
.. |alias| replace:: :mc-cmd-option:`~mc cat ALIAS`
Syntax
------
.. start-mc-cat-desc
The :mc:`mc cat` command concatenates the contents of a file or
object to another file or object. You can also use the command to
display the contents of the specified file or object to ``STDOUT``.
:mc:`~mc cat` has similar functionality to ``cat``.
.. end-mc-cat-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command concatenates the contents of an object on a
MinIO deployment to ``STDOUT``:
.. code-block:: shell
:class: copyable
mc cat play/mybucket/myobject.txt
.. tab-item:: SYNTAX
The command command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] cat \
[--rewind] \
[--version-id] \
[--encrypt-key] \
PATH
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
You can also use :mc:`mc cat` against a local filesystem to produce similar
results to the ``cat`` commandline tool:
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO or other S3-compatible
service.
.. mc-cmd:: PATH
*Required* The full path to an object on the specified alias.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
.. mc-cmd:: encrypt-key
:option:
Encrypt or decrypt objects using server-side encryption with
client-specified keys. Specify key-value pairs as ``KEY=VALUE``.
- Each ``KEY`` represents a bucket or object.
- Each ``VALUE`` represents the data key to use for encrypting
object(s).
Enclose the entire list of key-value pairs passed to
:mc-cmd-option:`~mc cat encrypt-key` in double quotes ``"``.
:mc-cmd-option:`~mc cat encrypt-key` can use the ``MC_ENCRYPT_KEY``
environment variable for retrieving a list of encryption key-value pairs
as an alternative to specifying them on the command line.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
View an S3 Object
~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc cat` to return the object:
.. code-block:: shell
:class: copyable
mc cat ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc cat ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc cat ALIAS>` with the path to the object on the
S3-compatible host.
View an S3 Object at a Point-In-Time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc cat rewind` to return the object at a specific
point-in-time in the past:
.. code-block:: shell
:class: copyable
mc cat ALIAS/PATH --rewind DURATION
- Replace :mc-cmd:`ALIAS <mc cat ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc cat ALIAS>` with the path to the object on the
S3-compatible host.
- Replace :mc-cmd:`DURATION <mc cat rewind>` with the point-in-time in the past
at which the command returns the object. For example, specify ``30d`` to
return the version of the object 30 days prior to the current date.
.. include:: /includes/facts-versioning.rst
:start-after: start-versioning-admonition
:end-before: end-versioning-admonition
View an S3 Object with Specific Version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc cat version-id` to return a specific version of the
object:
.. code-block:: shell
mc cat ALIAS/PATH --version-id VERSION
- Replace :mc-cmd:`ALIAS <mc cat ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc cat ALIAS>` with the path to the object on the
S3-compatible host.
- Replace :mc-cmd:`VERSION <mc cat version-id>` with the specific version of the
object to return.
.. include:: /includes/facts-versioning.rst
:start-after: start-versioning-admonition
:end-before: end-versioning-admonition
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,454 @@
.. _minio-mc-cp:
=========
``mc cp``
=========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc cp
.. |command| replace:: :mc-cmd:`mc cp`
.. |rewind| replace:: :mc-cmd-option:`~mc cp rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc cp version-id`
.. |alias| replace:: :mc-cmd-option:`~mc cp SOURCE`
Syntax
------
.. start-mc-cp-desc
The :mc:`mc cp` command copies objects to or from a MinIO deployment, where
the source can MinIO *or* a local filesystem.
.. end-mc-cp-desc
You can also use :mc:`mc cp` against the local filesystem to produce
similar results to the ``cp`` commandline tool.
.. tab-set::
.. tab-item:: EXAMPLE
The following command copies files from a local filesystem directory
to the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc cp --recursive ~/mydata/ myminio/mydata/
.. tab-item:: SYNTAX
The command command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] cp \
[--attr "string"] \
[--continue] \
[--disable-multipart] \
[--encrypt "string"] \
[--encrypt-key] \
[--legal-hold "on"] \
[--md5] \
[--newer-than "string"] \
[--older-than "string"] \
[--preserve] \
[--recursive] \
[--retention-mode "string" --retention-duration "string"] \
[--rewind "string"] \
[--storage-class "string"] \
[--tags "string"] \
[--version-id "string"] \
SOURCE TARGET
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: SOURCE
*Required* The object or objects to copy.
For copying an object from MinIO or another S3-compatible service,
specify the :ref:`alias <alias>` and the full path to that
object (e.g. bucket and path to object). For example:
.. code-block:: none
mc cp play/mybucket/object.txt ~/mydata/object.txt
For copying an object from a local filesystem, specify the full
path to that object. For example:
.. code-block:: none
mc cp ~/mydata/object.txt play/mybucket/object.txt
If you specify a directory or bucket to :mc-cmd:`~mc cp SOURCE`, you must
also specify :mc-cmd-option:`~mc cp recursive` to recursively copy the
contents of that directory or bucket. If you omit the ``--recursive``
argument, :mc:`~mc cp` only copies objects in the top level of the specified
directory or bucket.
.. mc-cmd:: TARGET
*Required* The full path to which :mc:`mc cp` copies the object.
For copying an object to MinIO or another S3-compatible service,
specify the :mc:`alias <mc alias>` and the full path to that object
(e.g. bucket and path to object). For example:
.. code-block:: none
mc cp ~/mydata/object.txt play/mybucket/object.txt
For copying an object from a local filesystem, specify the full
path to that object. For example:
.. code-block:: none
mc cp play/mybucket/object.txt ~/mydata/object.txt
.. mc-cmd:: attr
:option:
*Optional* Add custom metadata for the object. Specify key-value pairs as
``KEY=VALUE\;``. For example, ``--attr
key1=value1\;key2=value2\;key3=value3``.
.. mc-cmd:: continue, c
:option:
*Optional* Create or resume a copy session.
.. mc-cmd:: disable-multipart
:option:
*Optional* Disables multipart upload for the copy session.
.. mc-cmd:: encrypt
:option:
*Optional* Encrypt or decrypt objects using
:ref:`server-side encryption <minio-sse>` with
server-managed keys. Specify key-value pairs as ``KEY=VALUE``.
- Each ``KEY`` represents a bucket or object.
- Each ``VALUE`` represents the data key to use for encrypting
object(s).
Enclose the entire list of key-value pairs passed to
:mc-cmd-option:`~mc cp encrypt` in double-quotes ``"``.
:mc-cmd-option:`~mc cp encrypt` can use the ``MC_ENCRYPT`` environment
variable for retrieving a list of encryption key-value pairs as an
alternative to specifying them on the command line.
.. mc-cmd:: encrypt-key
:option:
*Optional* Encrypt or decrypt objects using server-side encryption with
client-specified keys. Specify key-value pairs as ``KEY=VALUE``.
- Each ``KEY`` represents a bucket or object.
- Each ``VALUE`` represents the data key to use for encrypting
object(s).
Enclose the entire list of key-value pairs passed to
:mc-cmd-option:`~mc cp encrypt-key` in double quotes ``"``.
:mc-cmd-option:`~mc cp encrypt-key` can use the ``MC_ENCRYPT_KEY``
environment variable for retrieving a list of encryption key-value pairs
as an alternative to specifying them on the command line.
.. mc-cmd:: legal-hold
:option:
*Optional* Enables indefinite :ref:`Legal Hold
<minio-object-locking-legalhold>` object locking on the copied objects.
Specify ``on``.
.. mc-cmd:: md5
:option:
*Optional* Forces all uploads to calculate MD5 checksums.
.. mc-cmd:: newer-than
:option:
*Optional* Remove object(s) newer than the specified number of days. Specify
a string in ``#d#hh#mm#ss`` format. For example: ``--older-than 1d2hh3mm4ss``
Defaults to ``0`` (all objects).
.. mc-cmd:: older-than
:option:
*Optional* Remove object(s) older than the specified time limit. Specify a
string in ``#d#hh#mm#ss`` format. For example: ``--older-than 1d2hh3mm4ss``
Defaults to ``0`` (all objects).
.. mc-cmd:: preserve, a
:option:
*Optional* Preserve file system attributes and bucket policy rules of the
:mc-cmd:`~mc cp SOURCE` directories, buckets, and objects on the
:mc-cmd:`~mc cp TARGET` bucket(s).
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively copy the contents of each bucket or directory
:mc-cmd:`~mc cp SOURCE` to the :mc-cmd:`~mc cp TARGET` bucket.
.. mc-cmd:: retention-duration
:option:
*Optional* The duration of the :ref:`WORM retention mode
<minio-object-locking-retention-modes>` to apply to the copied object(s).
Specify the duration as a string in
``#d#hh#mm#ss`` format. For example: ``--retention-duration "1d2hh3mm4ss"``.
Requires specifying :mc-cmd-option:`~mc cp retention-mode`.
.. mc-cmd:: retention-mode
:option:
*Optional* enables :ref:`object locking mode
<minio-object-locking-retention-modes>` on the copied object(s).
Supports the following values:
- ``GOVERNANCE``
- ``COMPLIANCE``
Requires specifying :mc-cmd-option:`~mc cp retention-duration`.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: storage-class, sc
:option:
*Optional* Set the storage class for the new object(s) on the
:mc-cmd:`~mc cp TARGET`.
See :aws-docs:`AmazonS3/latest/dev/storage-class-intro.html` for
more information on S3 storage classses.
.. mc-cmd:: tags
:option:
*Optional* Applies one or more tags to the copied objects.
Specify an ampersand-seperated list of key-value pairs as
``KEY1=VALUE1&KEY2=VALUE2``, where each pair represents one tag to
assign to the objects.
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Copy Object to S3
~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc cp` to copy an object to an S3-compatible host:
.. tab-set::
.. tab-item:: Filesystem to S3
.. code-block:: shell
:class: copyable
mc cp SOURCE ALIAS/PATH
- Replace :mc-cmd:`SOURCE <mc cp SOURCE>` with the filesystem path to the
object.
- Replace :mc-cmd:`ALIAS <mc cp TARGET>` with the :mc:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc cp TARGET>` with the path to the object on
the S3-compatible host. You can specify a different object name to
"rename" the object on copy.
.. tab-item:: S3 to S3
.. code-block:: shell
:class: copyable
mc cp SRCALIAS/SRCPATH TGTALIAS/TGTPATH
- Replace :mc-cmd:`SRCALIAS <mc cp SOURCE>` with the
:mc:`alias <mc alias>` of a source S3-compatible host.
- Replace :mc-cmd:`SRCPATH <mc cp SOURCE>` with the path to the
object on the S3-compatible host.
- Replace :mc-cmd:`TGTALIAS <mc cp TARGET>` with the
:mc:`alias <mc alias>` of a target S3-compatible host.
- Replace :mc-cmd:`TGTPATH <mc cp TARGET>` with the path to the
object on a target S3-compatible host. Omit the object name to use
the ``SRCPATH`` object name.
Recursively Copy Objects to S3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc cp recursive` to recursively copy objects to an
S3-compatible host:
.. tab-set::
.. tab-item:: Filesystem to S3
.. code-block:: shell
:class: copyable
mc cp --recursive SOURCE ALIAS/PATH
- Replace :mc-cmd:`SOURCE <mc cp SOURCE>` with the filesystem path to the
directory containing the file(s).
- Replace :mc-cmd:`ALIAS <mc cp TARGET>` with the :mc:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc cp TARGET>` with the path to the object on
the S3-compatible host. :mc-cmd:`mc cp` uses the ``SOURCE`` filenames
when creating the objects on the target host.
.. tab-item:: S3 to S3
.. code-block:: shell
:class: copyable
mc cp --recursive SRCALIAS/SRCPATH TGTALIAS/TGTPATH
- Replace :mc-cmd:`SRCALIAS <mc cp SOURCE>` with the
:mc:`alias <mc alias>` of a source S3-compatible host.
- Replace :mc-cmd:`SRCPATH <mc cp SOURCE>` with the path to the
bucket or bucket prefix on the source S3-compatible host.
- Replace :mc-cmd:`TGTALIAS <mc cp TARGET>` with the
:mc:`alias <mc alias>` of a target S3-compatible host.
- Replace :mc-cmd:`TGTPATH <mc cp TARGET>` with the path to the
object on the target S3-compatible host. :mc-cmd:`mc cp` uses the
``SRCPATH`` object names when creating objects on the target
host.
Copy Point-In-Time Version of Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc cp rewind` to copy an object as it existed at a
specific point in time. This command only applies to S3-to-S3 copy.
.. code-block:: shell
:class: copyable
mc cp --rewind DURATION SRCALIAS/SRCPATH TGTALIAS/TGTPATH
- Replace :mc-cmd:`DURATION <mc cp rewind>` with the point-in-time in the
past at which the command copies the object. For example, specify
``30d`` to copy the version of the object 30 days prior to the
current date.
- Replace :mc-cmd:`SRCALIAS <mc cp SOURCE>` with the
:mc:`alias <mc alias>` of a source S3-compatible host.
- Replace :mc-cmd:`SRCPATH <mc cp SOURCE>` with the path to the
object on the source S3-compatible host.
- Replace :mc-cmd:`TGTALIAS <mc cp TARGET>` with the
:mc:`alias <mc alias>` of a target S3-compatible host.
- Replace :mc-cmd:`TGTPATH <mc cp TARGET>` with the path to the
object on the target S3-compatible host. Omit the object name to use
the ``SRCPATH`` object name.
.. include:: /includes/facts-versioning.rst
:start-after: start-versioning-admonition
:end-before: end-versioning-admonition
Copy Specific Version of Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc cp version-id` to copy a specific version of an object. This
command only applies to S3-to-S3 copy.
.. code-block:: shell
:class: copyable
mc cp --version-id VERSION SRCALIAS/SRCPATH TGTALIAS/TGTPATH
- Replace :mc-cmd:`VERSION <mc cp rewind>` with the version of the object to
copy.
- Replace :mc-cmd:`SRCALIAS <mc cp SOURCE>` with the
:mc:`alias <mc alias>` of a source S3-compatible host.
- Replace :mc-cmd:`SRCPATH <mc cp SOURCE>` with the path to the
object on the source S3-compatible host.
- Replace :mc-cmd:`TGTALIAS <mc cp TARGET>` with the
:mc:`alias <mc alias>` of a target S3-compatible host.
- Replace :mc-cmd:`TGTPATH <mc cp TARGET>` with the path to the
object on the target S3-compatible host. Omit the object name to use
the ``SRCPATH`` object name.
.. include:: /includes/facts-versioning.rst
:start-after: start-versioning-admonition
:end-before: end-versioning-admonition
Behavior
--------
:mc:`mc cp` verifies all copy operations to object storage using MD5SUM
checksums.
Interrupted or failed copy operations can resume from the point of failure
by issuing the :mc:`mc cp` operation again with the
:mc-cmd-option:`~mc cp continue` argument.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,134 @@
.. _minio-mc-diff:
===========
``mc diff``
===========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc diff
Syntax
------
.. start-mc-diff-desc
The :mc:`mc diff` mc computes the differences between two filesystem directories
or MinIO buckets. :mc:`mc diff` lists only those objects which are missing or
which differ in size. :mc:`mc diff` does **not** compare the contents of
objects.
.. end-mc-diff-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command computes the difference between an object on
a local filesystem and an object in the ``mydata`` bucket on the
``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc diff ~/mydata/myobject.txt myminio/mydata/myobject.txt
.. tab-item:: SYNTAX
The command command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] diff SOURCE TARGET
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: SOURCE
*Required* The object to compare to the ``TARGET``.
For an object from MinIO or another S3-compatible service,
specify the :mc:`alias <mc alias>` and the full path to that
object (e.g. bucket and path to object). For example:
.. code-block:: none
mc diff play/mybucket/object.txt ~/mydata/object.txt
For an object from a local filesystem, specify the full
path to that object. For example:
.. code-block:: none
mc diff ~/mydata/object.txt play/mybucket/object.txt
.. mc-cmd:: TARGET
*Required* The object to compare to the ``SOURCE``.
For an object from MinIO or another S3-compatible service,
specify the :mc:`alias <mc alias>` and the full path to that
object (e.g. bucket and path to object). For example:
.. code-block:: none
mc diff play/mybucket/object.txt ~/mydata/object.txt
For an object from a local filesystem, specify the full
path to that object. For example:
.. code-block:: none
mc diff ~/mydata/object.txt play/mybucket/object.txt
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
.. include:: /includes/play-alias-available.rst
:start-after: play-alias-only
:end-before: end-play-alias-only
.. code-block:: shell
:class: copyable
mc diff play/bucket1 play/bucket2
Behavior
--------
Output Legend
~~~~~~~~~~~~~
:mc:`mc diff` uses the following legend when formatting the diff output:
.. code-block:: none
FIRST < SECOND - object exists only in FIRST
FIRST > SECOND - object exists only in SECOND
FIRST ! SECOND - Newer object exists in FIRST
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,115 @@
.. _minio-mc-encrypt-clear:
====================
``mc encrypt clear``
====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc encrypt clear
Syntax
------
.. start-mc-encrypt-clear-desc
The :mc:`mc encrypt clear` command removes the current default
encryption settings for a bucket.
.. end-mc-encrypt-clear-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes the default encryption settings for
the ``mydata`` bucket on the MinIO deployment associated with the
``myminio`` :ref:`alias <alias>`:
.. code-block:: shell
:class: copyable
mc encrypt clear myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] encrypt clear ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
The full path to the bucket on which to remove the default SSE mode.
Specify the :ref:`alias <alias>` of the MinIO deployment as the prefix to the
ALIAS path. For example:
.. code-block:: shell
mc encrypt clear play/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Remove the Automatic Server-Side Encryption Settings for a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
.. code-block:: shell
:class: copyable
mc encrypt clear myminio/data
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc encrypt clear ALIAS
- Replace ``ALIAS`` with the :ref:`alias <alias>` of the
MinIO deployment on which to remove automatic server-side bucket
encryption.
Behavior
--------
Modifying Bucket Encryption Settings Does Not Affect Encrypted Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disabling automatic bucket encryption does *not* decrypt any objects in the
bucket.
To permanently decrypt objects in the bucket, you can perform an in-place
copy after disabling object decryption. For versioned buckets, the
previous object versions remain encrypted.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,104 @@
.. _minio-mc-encrypt-info:
===================
``mc encrypt info``
===================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc encrypt info
Syntax
------
.. start-mc-encrypt-info-desc
The :mc:`mc encrypt info` command returns the current default
encryption settings for a bucket.
.. end-mc-encrypt-info-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command returns the default encryption setting for the
``mydata`` bucket on the ``myminio`` MinIO deployment.
.. code-block:: shell
:class: copyable
mc encrypt info myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] encrypt info ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
The full path to the bucket on which to retrieve the default SSE mode.
Specify the :ref:`alias <alias>` of the MinIO deployment as the prefix to the
ALIAS path. For example:
.. code-block:: shell
mc encrypt info play/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Retrieve the Automatic Server-Side Encryption Settings for a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
.. code-block:: shell
:class: copyable
mc encrypt info myminio/data
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc encrypt info ALIAS
- Replace ``ALIAS`` with the :ref:`alias <alias>` of the
MinIO deployment on which to configure automatic server-side bucket
encryption.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,151 @@
.. _minio-mc-encrypt-set:
==================
``mc encrypt set``
==================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc encrypt set
Syntax
------
.. start-mc-encrypt-set-desc
The :mc:`mc encrypt set` encrypt command sets or updates the default
bucket :ref:`Server-Side Encryption (SSE) mode <minio-sse>`. MinIO automatically
encrypts objects written to that bucket using the specified SSE mode.
.. end-mc-encrypt-set-desc
:mc:`mc encrypt set` only supports :ref:`SSE-KMS <minio-encryption-sse-kms>`
and :ref:`SSE-S3 <minio-encryption-sse-s3>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command sets the default
:ref:`SSE-KMS encryption key <minio-encryption-sse-kms>` for the bucket
``mydata`` on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc encrypt set sse-kms "minio-encryption-key" myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] encrypt set ENCRYPTION [KMSKEY] ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ENCRYPTION
Specify the server-side encryption type to use as the default SSE mode.
Supports the following values:
- ``sse-kms`` - Encrypt objects using the key specified in
:mc-cmd:`~mc encrypt set KMSKEY`. MinIO
must have access to the specified key on the external KMS to
successfully encrypt or decrypt objects protected using SSE-KMS.
- ``sse-s3`` - Encrypt objects using the key specified to
:envvar:`MINIO_KMS_KES_KEY_NAME`. MinIO must have access to the
specified key on the external KMS to successfully encrypt or decrypt
objects protected using SSE-S3.
.. mc-cmd:: KMSKEY
Specify the KMS Master Key to use for performing SSE object encryption. This
option only applies if :mc-cmd:`~mc encrypt set ENCRYPTION` is
``sse-kms``.
Omit this option to direct MinIO to use the
:envvar:`MINIO_KMS_KES_KEY_NAME`.
.. mc-cmd:: ALIAS
The full path to the bucket on which to set the default SSE mode. Specify the
:ref:`alias <alias>` of the MinIO deployment as the prefix to the TARGET
path. For example:
.. code-block:: shell
mc encrypt set ENCRYPTION [KMSKEY] play/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Enable Automatic Server-Side Bucket Encryption
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
The following commands assumes that:
- The MinIO server configuration supports
:ref:`SSE-KMS <minio-encryption-sse-kms>`
- The root has an encryption key ``minio-encryption-key``.
.. code-block:: shell
:class: copyable
mc encrypt set sse-kms minio-encryption-key myminio/data
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc encrypt set ENCRYPTION KMSKEY TARGET
- Replace ``ENCRYPTION`` with ``sse-kms`` or ``sse-s3`` depending
on the preferred encryption mode.
- Replace ``KMSKEY`` with the name of the encryption key on the
configured root KMS. This argument has no effect with ``sse-s3``.
- Replace ``TARGET`` with the :ref:`alias <alias>` of the
MinIO deployment on which to configure automatic server-side bucket
encryption.
Behavior
--------
:mc:`mc encrypt set` makes no assumptions about the MinIO server's current
encryption state. Specifying default encryption settings which the
server cannot support may result in undesired behavior.
Setting or modifying the default server-side encryption settings does *not*
automatically encrypt or decrypt the existing bucket contents. If the bucket
contents *must* have consistent encryption, use the
:mc:`mc mv` mc with the :mc-cmd-option:`~mc mv encrypt` or
:mc-cmd-option:`~mc mv encrypt-key` arguments to manually modify the
encryption settings or encrypted state of the bucket contents *before*
changing the bucket default.

View File

@ -0,0 +1,239 @@
.. _minio-mc-event-add:
================
``mc event add``
================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc event add
Syntax
------
.. start-mc-event-add-desc
The :mc:`mc event add` command adds event notification triggers to a bucket.
.. end-mc-event-add-desc
MinIO automatically sends triggered events to the configured
:ref:`notification target <minio-bucket-notifications>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command creates a new event notification trigger for
all ``PUT`` and ``DELETE`` operations for the ``mydata`` bucket on the
``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc event add --event "put,delete" myminio/mydata arn:aws:sqs::primary:target
The specified ARN corresponds to a configured
:ref:`bucket notification target <minio-bucket-notifications>` on the
``myminio`` deployment.
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] event add \
[--event "string"] \
[--ignore-existing] \
[--prefix "string"] \
[--suffix "string"] \
ALIAS \
ARN
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The MinIO :ref:`alias <alias>` and bucket to
which the command adds the new event notification. For example:
.. code-block:: shell
mc event add play/mybucket
.. mc-cmd:: ARN
*Required* The :aws-docs:`Amazon Resource Name (ARN)
<general/latest/gr/aws-arns-and-namespaces>` of the notification target.
The MinIO server outputs an ARN for each configured
notification target at server startup. See
:doc:`/monitoring/bucket-notifications/bucket-notifications` for more
information.
.. mc-cmd:: event
:option:
*Optional* The event(s) for which MinIO generates bucket notifications.
Supports the following values:
- ``put``
- ``get``
- ``delete``
Specify multiple value using a comma ``,`` delimiter.
Defaults to ``put,delete,get``.
See :ref:`mc-event-supported-events` for a detailed list of S3 events
associated to each of the supported values.
.. mc-cmd:: ignore-existing, p
:option:
*Optional* Directs MinIO to ignore applying the specified event
triggers if an existing matching trigger exists.
.. mc-cmd:: prefix
:option:
*Optional* The bucket prefix in which the specified
:mc-cmd-option:`~mc event add event` can trigger a bucket notification.
For example, given a :mc-cmd:`~mc event add ALIAS` of ``play/mybucket``
and a :mc-cmd-option:`~mc event add prefix` of ``photos``, only events in
``play/mybucket/photos`` trigger bucket notifications.
Omit to trigger the event for all prefixes and objects in the bucket.
.. mc-cmd:: suffix
:option:
*Optional* The bucket suffix in which the specified
:mc-cmd-option:`~mc event add event` can trigger a bucket notification.
For example, given a :mc-cmd:`~mc event add ALIAS` of ``play/mybucket``
and a :mc-cmd-option:`~mc event add suffix` of ``.jpg``, only events in
``play/mybucket/*.jpg`` trigger bucket notifications.
Omit to trigger the event for all objects regardless of suffix.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Add an Event Notification to a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
The following command adds a new event notification trigger for all
S3 ``PUT``, ``GET``, and ``DELETE`` operations on a bucket. The command
assumes the MinIO deployment has at least one configured
:ref:`bucket notification target <minio-bucket-notifications>`:
.. code-block:: shell
:class: copyable
mc event add myminio/mydata arn:minio:sqs::primary:webhook
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc event add ALIAS ARN
- Replace ``ALIAS`` with the :ref:`alias <alias>` of the MinIO
deployment and the bucket on which to add the bucket notification event.
For example:
``myminio/mydata``
- Replace ``ARN`` with the notification target
:mc-cmd:`ARN <mc event add ARN>`.
Behavior
--------
.. _mc-event-supported-events:
Supported Bucket Events
~~~~~~~~~~~~~~~~~~~~~~~
The following table lists the supported :mc-cmd:`mc event add` values and their
corresponding :ref:`S3 events <minio-bucket-notifications-event-types>`:
.. list-table::
:header-rows: 1
:widths: 30 70
:width: 100%
* - Supported Vluae
- Corresponding S3 Events
* - ``put``
- | :data:`s3:ObjectCreated:CompleteMultipartUpload`
| :data:`s3:ObjectCreated:Copy`
| :data:`s3:ObjectCreated:DeleteTagging`
| :data:`s3:ObjectCreated:Post`
| :data:`s3:ObjectCreated:Put`
| :data:`s3:ObjectCreated:PutLegalHold`
| :data:`s3:ObjectCreated:PutRetention`
| :data:`s3:ObjectCreated:PutTagging`
* - ``get``
- | :data:`s3:ObjectAccessed:Head`
| :data:`s3:ObjectAccessed:Get`
| :data:`s3:ObjectAccessed:GetRetention`
| :data:`s3:ObjectAccessed:GetLegalHold`
* - ``delete``
- | :data:`s3:ObjectRemoved:Delete`
| :data:`s3:ObjectRemoved:DeleteMarkerCreated`
* - ``replica``
- | :data:`s3:Replication:OperationCompletedReplication`
| :data:`s3:Replication:OperationFailedReplication`
| :data:`s3:Replication:OperationMissedThreshold`
| :data:`s3:Replication:OperationNotTracked`
| :data:`s3:Replication:OperationReplicatedAfterThreshold`
* - ``ilm``
- | :data:`s3:ObjectTransition:Failed`
| :data:`s3:ObjectTransition:Complete`
| :data:`s3:ObjectRestore:Post`
| :data:`s3:ObjectRestore:Completed`
For more complete documentation on the listed S3 events, see
:s3-docs:`S3 Supported Event Types
<NotificationHowTo.html#notification-how-to-event-types-and-destinations>`.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,128 @@
.. _minio-mc-event-list:
=================
``mc event list``
=================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc event list
Syntax
------
.. start-mc-event-list-desc
The :mc:`mc event list` command lists all event notification triggers for a
bucket.
.. end-mc-event-list-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command lists all configured event notifications for the
specified :ref:`bucket notification target <minio-bucket-notifications>`
for the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc event list myminio myminio/mydata arn:aws:sqs::primary:target
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS]
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
.. code-block:: shell
mc [GLOBALFLAGS] event remove [FLAGS] ALIAS ARN
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The S3 service :ref:`alias <alias>` and bucket to
which the command lists event notification. For example:
.. code-block:: shell
mc event add play/mybucket
.. mc-cmd:: ARN
*Required* The :aws-docs:`Amazon Resource Name (ARN)
<general/latest/gr/aws-arns-and-namespaces>` of the bucket resource.
The MinIO server outputs an ARN for each configured notification target at
server startup. See
:doc:`/monitoring/bucket-notifications/bucket-notifications` for more
information.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List Event Notifications on a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
The following command lists all event notification triggers on a bucket.
.. code-block:: shell
:class: copyable
mc event list myminio/mydata
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc event list ALIAS ARN
- Replace ``ALIAS`` with the :ref:`alias <alias>` of the MinIO
deployment on which to add the bucket notification event. For example:
``myminio/mydata``
- Replace ``ARN`` with the notification target
:mc-cmd:`ARN <mc event add ARN>`.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,170 @@
.. _minio-mc-event-remove:
===================
``mc event remove``
===================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc event remove
Syntax
------
.. start-mc-event-remove-desc
The :mc:`mc event remove` command removes event notification triggers on a
bucket.
.. end-mc-event-remove-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes a configured event notifications for the
specified :ref:`bucket notification target <minio-bucket-notifications>`
for the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc event remove myminio/mydata arn:aws:sqs::primary:target
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] event remove \
[--event "string"] \
[--force] \
[--prefix "string"] \
[--suffix "string"] \
ALIAS \
[ARN]
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
.. code-block:: shell
mc [GLOBALFLAGS] event remove [FLAGS] ALIAS ARN
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The S3 service :ref:`alias <alias>` and bucket from
which the command removes the event notification. For example:
.. code-block:: shell
mc event add play/mybucket
.. mc-cmd:: ARN
*Required* The :aws-docs:`Amazon Resource Name (ARN)
<general/latest/gr/aws-arns-and-namespaces>` of the notification target.
The MinIO server outputs an ARN for each configured
notification target at server startup. See
:ref:`minio-bucket-notifications` for more
information.
.. mc-cmd:: event
:option:
*Optional* The event(s) to remove. Specify multiple events using a comma
``,`` delimiter. See :ref:`mc-event-supported-events` for supported events.
Defaults to removing all events on the :mc-cmd:`~mc event remove ALIAS`
bucket with the :mc-cmd-option:`~mc event remove ARN` notification target.
.. mc-cmd:: force
:option:
*Optional* Removes all events on the :mc-cmd:`~mc event remove ALIAS` bucket
with the :mc-cmd-option:`~mc event remove ARN` notification target.
.. mc-cmd:: prefix
:option:
*Optional* The bucket prefix in which the command removes bucket
notifications.
For example, given a :mc-cmd:`~mc event remove ALIAS` of
``play/mybucket`` and a :mc-cmd-option:`~mc event remove prefix` of
``photos``, the command only removes bucket notifications in
``play/mybucket/photos``.
.. mc-cmd:: suffix
:option:
*Optional* The bucket suffix in which the command removes bucket
notifications.
For example, given a :mc-cmd:`~mc event remove ALIAS` of
``play/mybucket`` and a :mc-cmd-option:`~mc event remove suffix` of
``.jpg``, the command only removes bucket notifications in
``play/mybucket/*.jpg``.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Remove Event Notifications from a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
The following command removes all event notification triggers on a bucket.
The command assumes the MinIO deployment has at least one configured
:ref:`bucket notification target <minio-bucket-notifications>`:
.. code-block:: shell
:class: copyable
mc event remove myminio/mydata arn:minio:sqs::primary:webhook
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc event remove ALIAS ARN
- Replace ``ALIAS`` with the :ref:`alias <alias>` of the MinIO
deployment on which to add the bucket notification event. For example:
``myminio/mydata``
- Replace ``ARN`` with the notification target
:mc-cmd:`ARN <mc event add ARN>`.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,312 @@
.. _minio-mc-find:
===========
``mc find``
===========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc find
Syntax
------
.. start-mc-find-desc
The :mc:`mc find` command supports searching for objects on a MinIO
deployment. You can also use the command to search for files on a filesystem.
.. end-mc-find-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command searches for all objects matching the specified
pattern in the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc find myminio/mydata --name "*.jpg"
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] find \
[--exec "string"] \
[--ignore "string"] \
[--larger "string"] \
[--maxdepth "string"] \
[--name "string"] \
[--newer-than "string"] \
[--older-than "string"] \
[--path "string"] \
[--print "string"] \
[--regex "string"] \
[--smaller "string"] \
[--watch] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required*
For objects on MinIO or an S3-compatible host, specify the
:ref:`alias <alias>` and the full path to search
(e.g. bucket and prefixes). For example:
.. code-block:: none
mc find play/mydata/
For objects on a filesyste, specify the full path to search. For
example:
.. code-block:: shell
mc find ~/mydata/
Issuing :mc-cmd:`mc find ALIAS` with no other arguments returns a list of
*all* objects or files at the specified path, similar to :mc-cmd:`mc ls`.
.. mc-cmd:: exec
:option:
*Optional* Spawns an external process for each object returned by
:mc:`mc find`. Supports :ref:`substitution formatting
<mc-find-substitution-format>` of the output.
.. mc-cmd:: ignore
:option:
*Optional* Exclude objects whose names match the specified wildcard pattern.
.. mc-cmd:: larger
:option:
*Optional* Match all objects larger than the specified size in
:ref:`units <mc-find-units>`.
.. mc-cmd:: maxdepth
:option:
*Optional* Limits directory navigation to the specified depth.
.. mc-cmd:: name
:option:
*Optional* Return objects whose names match the specified wildcard pattern.
.. mc-cmd:: newer-than
:option:
*Optional* Mirror object(s) newer than the specified number of days. Specify
a string in ``#d#hh#mm#ss`` format. For example: ``--older-than 1d2hh3mm4ss``
.. mc-cmd:: older-than
:option:
*Optional* Mirror object(s) older than the specified time limit. Specify a
string in ``#d#hh#mm#ss`` format. For example: ``--older-than 1d2hh3mm4ss``
Defaults to ``0`` (all objects).
.. mc-cmd:: path
:option:
*Optional* Return the contents of directories whose names match the specified
wildcard pattern.
.. mc-cmd:: print
:option:
*Optional* Prints results to ``STDOUT``. Supports
:ref:`substitution formatting <mc-find-substitution-format>` of the output.
.. mc-cmd:: regex
:option:
*Optional* Returns objects or the contents of directories whose names match
the specified PCRE regex pattern.
.. mc-cmd:: smaller
:option:
*Optional* Match all objects smaller than the specifized size in
:ref:`units <mc-find-units>`.
.. mc-cmd:: watch
:option:
*Optional* Continuously monitor the :mc-cmd:`~mc find ALIAS` and return any
new objects which match the specified criteria.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Find a Specific Object in a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: shell
:class: copyable
mc find ALIAS/PATH --name NAME
- Replace :mc-cmd:`ALIAS <mc find ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc find ALIAS>` with the path to a bucket on the
S3-compatible host. Omit the path to search from the root of the S3 host.
- Replace :mc-cmd:`NAME <mc find name>` with the object.
Find Objects with File Extention in Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: shell
:class: copyable
mc find ALIAS/PATH --name *.EXTENSION
- Replace :mc-cmd:`ALIAS <mc find ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc find ALIAS>` with the path to a bucket on the
S3-compatible host.
- Replace :mc-cmd:`EXTENSION <mc find name>` with the file extention of the
object.
Find All Matching Files and Copy To S3 Service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc find` with the :mc-cmd-option:`~mc find exec` option to find
files on a local filesystem and pass them to an :program:`mc` command for
further processing. The following example uses :mc:`mc cp` to copy the
output of :mc:`mc find` to an S3-compatible host.
.. code-block:: shell
:class: copyable
mc find FILEPATH --name "*.EXTENSION" --exec "mc cp {} ALIAS/PATH"
- Replace :mc-cmd:`FILEPATH <mc find ALIAS>` with the full file path to the
directory to search.
- Replace :mc-cmd:`EXTENSION <mc find name>` with the file extention of the
object.
- Replace :mc-cmd:`ALIAS <mc find ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc find ALIAS>` with the path to a bucket on the
S3-compatible host.
To continuously watch the specified directory and copy new objects,
include the :mc-cmd-option:`~mc find watch` argument:
.. code-block:: shell
:class: copyable
mc find --watch FILEPATH --name "*.EXTENSION" --exec "mc cp {} ALIAS/PATH"
Behavior
--------
.. _mc-find-units:
Units of Measurement
~~~~~~~~~~~~~~~~~~~~
The :mc-cmd-option:`mc find smaller` and :mc-cmd-option:`mc find larger` flags
accept the following case-insensitive suffixes to represent the unit of the
specified size value:
.. list-table::
:header-rows: 1
:widths: 20 80
:width: 100%
* - Suffix
- Unit Size
* - ``k``
- KB (Kilobyte, 1000 Bytes)
* - ``m``
- MB (Megabyte, 1000 Kilobytes)
* - ``g``
- GB (Gigabyte, 1000 Megabytes)
* - ``t``
- TB (Terrabyte, 1000 Gigabytes)
* - ``ki``
- KiB (Kibibyte, 1024 Bites)
* - ``mi``
- MiB (Mebibyte, 1024 Kibibytes)
* - ``gi``
- GiB (Gibibyte, 1024 Mebibytes)
* - ``ti``
- TiB (Tebibyte, 1024 Gibibytes)
Omitting the suffix defaults to ``bytes``.
.. _mc-find-substitution-format:
Substitution Format
~~~~~~~~~~~~~~~~~~~
The :mc-cmd-option:`mc find exec` and :mc-cmd-option:`mc find print` commands
support string substitutions with special interpretations for following
keywords.
The following keywords are supported for both filesystem and S3 service targets:
- ``{}`` - Substitutes to full path.
- ``{base}`` - Substitutes to basename of path.
- ``{dir}`` - Substitutes to dirname of the path.
- ``{size}`` - Substitutes to object size of the path.
- ``{time}`` - Substitutes to object modified time of the path.
The following keyword is supported only for S3 service targets:
- ``{url}`` - Substitutes to a shareable URL of the path.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,214 @@
.. _minio-mc-head:
===========
``mc head``
===========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc head
.. |command| replace:: :mc-cmd:`mc head`
.. |rewind| replace:: :mc-cmd-option:`~mc head rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc head version-id`
.. |alias| replace:: :mc-cmd-option:`~mc head ALIAS`
Syntax
------
.. start-mc-head-desc
The :mc:`mc head` command displays the first ``n`` lines of an object,
where ``n`` is an argument specified to the command.
.. end-mc-head-desc
:mc:`mc head` does not perform any transformation or formatting of object
contents to facilitate readability. You can also use :mc:`mc head` against
the local filesystem to produce similar results to the ``head`` commandline
tool.
.. tab-set::
.. tab-item:: EXAMPLE
The following command returns the first 10 lines of an object in the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc head myminio/mydata/myobject.txt
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] head \
[--lines int] \
[--rewind "string"] \
[--version-id "string"] \
[--encrypt-key "string"] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The object or objects to print.
For an object on MinIO or another S3-compatible service, specify the
:ref:`alias <alias>` and the full path to that object (e.g. bucket and path
to object). For example:
For example:
.. code-block:: none
mc head play/mybucket/object.txt
For an object on a local filesystem, specify the full path to that object.
For example:
.. code-block:: none
mc head ~/mydata/object.txt
.. mc-cmd:: lines, n
:option:
*Optional* The number of lines to print.
Defaults to ``10``.
.. mc-cmd:: encrypt-key
:option:
*Optional* Encrypt or decrypt objects using server-side encryption with
client-specified keys. Specify key-value pairs as ``KEY=VALUE``.
- Each ``KEY`` represents a bucket or object.
- Each ``VALUE`` represents the data key to use for encrypting
object(s).
Enclose the entire list of key-value pairs passed to
:mc-cmd-option:`~mc head encrypt-key` in double quotes ``"``.
:mc-cmd-option:`~mc head encrypt-key` can use the ``MC_ENCRYPT_KEY``
environment variable for retrieving a list of encryption key-value pairs
as an alternative to specifying them on the command line.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
View Partial Contents of an Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc head` to return the first 10 lines of an object:
.. code-block:: shell
:class: copyable
mc head ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc head ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc head ALIAS>` with the path to the object on the
S3-compatible host.
View Partial Contents of an Object at a Point in Time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc head rewind` to return the first 10 lines of the
object at a specific point-in-time in the past:
.. code-block:: shell
:class: copyable
mc head ALIAS/PATH --rewind DURATION
- Replace :mc-cmd:`ALIAS <mc head ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc head ALIAS>` with the path to the object on the
S3-compatible host.
- Replace :mc-cmd:`DURATION <mc head rewind>` with the point-in-time in the past
at which the command returns the object. For example, specify ``30d`` to
return the version of the object 30 days prior to the current date.
.. include:: /includes/facts-versioning.rst
:start-after: start-versioning-admonition
:end-before: end-versioning-admonition
View Partial Contents of an Object with Specific Version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc head version-id` to return the first 10 lines of the
object at a specific point-in-time in the past:
.. code-block:: shell
:class: copyable
mc head ALIAS/PATH --version-id VERSION
- Replace :mc-cmd:`ALIAS <mc head ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc head ALIAS>` with the path to the object on the
S3-compatible host.
- Replace :mc-cmd:`VERSION <mc head version-id>` with the version of the object.
For example, specify ``30d`` to return the version of the object 30 days prior
to the current date.
.. include:: /includes/facts-versioning.rst
:start-after: start-versioning-admonition
:end-before: end-versioning-admonition
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,288 @@
.. _minio-mc-ilm-add:
==============
``mc ilm add``
==============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc ilm add
Syntax
------
.. start-mc-ilm-add-desc
The :mc:`mc ilm add` command adds an object lifecycle management rule to a
bucket.
.. end-mc-ilm-add-desc
The command supports adding both
:ref:`Transition (Tiering) <minio-lifecycle-management-tiering>` and
:ref:`Expiration <minio-lifecycle-management-expiration>` lifecycle management
rules.
.. tab-set::
.. tab-item:: EXAMPLE
The following command adds new lifecycle management rules to the
``mydata`` bucket on the ``myminio`` deployment:
.. code-block:: shell
:class: copyable
mc ilm add --expiry-days 90 --noncurrentversion-expiry-days 30 mydata/myminio
mc ilm add --expired-object-delete-marker mydata/myminio
mc ilm add --transition-days 30 --storage-class "COLDTIER" mydata/myminio
mc ilm add --noncurrentversion-transition-days 7 --noncurrent-version-transition-storage-class "COLDTIER"
The configured rules have the following effect:
- Delete objects more than 90 days old
- Delete objects 30 days after they become non-current
- Delete ``DeleteMarker`` tombstones if that object has no other versions
remaining.
- Transition objects more than 30 days old to the ``COLDTIER`` remote
tier.
- Transition objects 7 days after they become non-current to the
``COLDTIER`` remote tier.
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ilm add \
--expiry-days "string" | --expired-object-delete-marker \
--transition-days "string" --storage-class "string" \
[--noncurrentversion-expiration-days "string"] \
[--noncurrentversion-transition-days "string" --noncurrentversion-transition-storage-class "string"] \
[--tags] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` and full path to the bucket on the MinIO
deployment to which to add the object lifecycle management rule. For example:
.. code-block:: none
mc ilm add myminio/mydata
To restrict the management rule to a specific bucket prefix, specify that
prefix as part of the ``ALIAS``. For example:
.. code-block:: none
mc ilm add myminio/mydata/someprefix
.. mc-cmd:: expiry-days
:option:
*Required* The number of days to retain an object after being created. MinIO
marks the object for deletion after the specified number of days pass.
Specify the number of days as an integer, e.g. ``30`` for 30 days.
For versioned buckets, the expiry rule applies only to the *current*
object version. Use the
:mc-cmd-option:`~mc ilm add noncurrentversion-expiration-days` option
to apply expiration behavior to noncurrent object versions.
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
Mutually exclusive with the following options:
- :mc-cmd-option:`~mc ilm add expired-object-delete-marker`
For more complete documentation on object expiration, see
:ref:`minio-lifecycle-management-expiration`.
.. mc-cmd:: expired-object-delete-marker
:option:
*Required* Specify this option to direct MinIO to remove delete markers for
objects with no remaining object versions. Specifically, the delete
marker is the *only* remaining "version" of the given object.
This option is mutually exclusive with the following option:
- :mc-cmd-option:`~mc ilm add tags`
- :mc-cmd-option:`~mc ilm add expiry-days`
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
For more complete documentation on object expiration, see
:ref:`minio-lifecycle-management-expiration`.
.. mc-cmd:: transition-days
:option:
*Required* The number of calendar days from object creation after which MinIO
marks an object as eligible for transition. MinIO transitions the object to
the configured remote storage tier specified to the
:mc-cmd-option:`~mc ilm add storage-class`. Specify the number of days as an
integer, e.g. ``30`` for 30 days.
For versioned buckets, the transition rule applies only to the *current*
object version. Use the
:mc-cmd-option:`~mc ilm add noncurrentversion-transition-days` option
to apply transition behavior to noncurrent object versions.
Requires specifying :mc-cmd-option:`~mc ilm add storage-class`.
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
For more complete documentation on object transition, see
:ref:`minio-lifecycle-management-tiering`.
.. mc-cmd:: storage-class
:option:
*Required* The remote storage tier to which MinIO
:ref:`transition objects <minio-lifecycle-management-tiering>`.
Specify a remote storage tier created by :mc-cmd:`mc admin tier`.
Required if specifying :mc-cmd-option:`~mc ilm add transition-days`.
.. mc-cmd:: tags
:option:
*Optional* One or more ampersand ``&``-delimited key-value pairs describing
the object tags to use for filtering objects to which the lifecycle
configuration rule applies.
This option is mutually exclusive with the following option:
- :mc-cmd-option:`~mc ilm add expired-object-delete-marker`
.. mc-cmd:: noncurrentversion-expiration-days
:option:
*Optional* The number of days to retain an object version after becoming
*non-current* (i.e. a different version of that object is now the `HEAD`).
MinIO marks noncurrent object versions for deletion after the specified
number of days pass.
This option has the same behavior as the
S3 ``NoncurrentVersionExpiration`` action.
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
.. mc-cmd:: noncurrentversion-transition-days
:option:
*Optional* The number of days an object has been non-current (i.e. replaced
by a newer version of that same object) after which MinIO marks the object
version as eligible for transition. MinIO transitions the object to the
configured remote storage tier specified to the
:mc-cmd-option:`~mc ilm add storage-class` once the system host datetime
passes that calendar date.
This option has no effect on non-versioned buckets. Requires specifying
:mc-cmd-option:`~mc ilm add noncurrentversion-transition-storage-class`.
This option has the same behavior as the
S3 ``NoncurrentVersionTransition`` action.
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
.. mc-cmd:: noncurrentversion-transition-storage-class
:option:
*Optional* The remote storage tier to which MinIO
:ref:`transitions noncurrent objects versions
<minio-lifecycle-management-tiering>`. Specify a remote storage tier created
by :mc-cmd:`mc admin tier`.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Expire Bucket Contents After Number of Days
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc ilm add` with :mc-cmd-option:`~mc ilm add expiry-days` to
expire bucket contents a number of days after object creation:
.. code-block:: shell
:class: copyable
mc ilm add ALIAS/PATH --expiry-days "DAYS"
- Replace :mc-cmd:`ALIAS <mc ilm add ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc ilm add ALIAS>` with the path to the bucket on the
S3-compatible host.
- Replace :mc-cmd:`DATE <mc ilm add expiry-days>` with the number of days after
which to expire the object. For example, specify ``30`` to expire the
object 30 days after creation.
Behavior
--------
Lifecycle Management Object Scanner
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
Expiry vs Transition
~~~~~~~~~~~~~~~~~~~~
MinIO supports specifying both expiry and transition rules in the same
bucket or bucket prefix. MinIO can execute an expiration rule on an object
regardless of its transition status. Use
:mc-cmd:`mc ilm ls` to review the currently configured object lifecycle
management rules for any potential interactions between expiry and transition
rules.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,268 @@
.. _minio-mc-ilm-edit:
===============
``mc ilm edit``
===============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc ilm edit
Syntax
------
.. start-mc-ilm-edit-desc
The :mc:`mc ilm edit` command modifies an existing object lifecycle management
rule on a MinIO bucket.
.. end-mc-ilm-edit-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command modifies existing lifecycle management rules for
the ``mydata`` bucket on the ``myminio`` deployment:
.. code-block:: shell
:class: copyable
mc ilm edit --id "c79ntj94b0t6rukh6lr0" --expiry-days 90 mydata/myminio
mc ilm edit --id "c79nu2p4b0t6qko19rgg" --expired-object-delete-marker mydata/myminio
mc ilm edit --id "c79n19dn10dnab109fg1" --transition-days 30 --storage-class "COLDTIER"
The command modifies the specified rules as follows:
- Delete objects more than 90 days old.
- Delete ``DeleteMarker`` tombstones if that object has no other versions
remaining.
- Transition objects more than 30 days old to the ``COLDTIER`` remote
tier.
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ilm edit \
--id "string" \
[--expiry-days "string" | --expired-object-delete-marker] \
[--transition-days "string"] --storage-class "string" \
[--noncurrentversion-expiration-days "string"] \
[--noncurrentversion-transition-days "string" --noncurrentversion-transition-storage-class "string"] \
[--tags] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` and full path to the bucket on the MinIO
deployment to which to modify the object lifecycle management rule. For
example:
.. code-block:: none
mc ilm edit myminio/mydata
.. mc-cmd:: id
:option:
*Required* The unique ID of the rule. Use :mc-cmd:`mc ilm ls` to list bucket
rules and retrieve the ``id`` for the rule you want to modify.
.. mc-cmd:: expiry-days
:option:
*Optional* The number of days to retain an object after being created. MinIO
marks the object for deletion after the specified number of days pass.
Exercise caution when using this option, as its behavior can result in
immediate expiration of uploaded objects. Any objects created *after*
the specified expiration date are automatically eligible for expiration.
Similarly, specifying a calendar date that is *prior* to the current
system host datetime marks all objects covered by the rule for deletion.
Consider immediately removing any ILM rule using this option once the
specified calendar date has passed.
For versioned buckets, the expiry rule applies only to the *current*
object version. Use the
:mc-cmd-option:`~mc ilm edit noncurrentversion-expiration-days` option
to apply expiration behavior to noncurrent object versions.
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
Mutually exclusive with the following options:
- :mc-cmd-option:`~mc ilm edit expired-object-delete-marker`
.. mc-cmd:: expired-object-delete-marker
:option:
*Optional* Specify this option to direct MinIO to remove delete markers for
objects with no remaining object versions. Specifically, the delete marker is
the *only* remaining "version" of the given object.
This option is mutually exclusive with the following option:
- :mc-cmd-option:`~mc ilm edit tags`
- :mc-cmd-option:`~mc ilm edit expiry-days`
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
.. mc-cmd:: noncurrentversion-expiration-days
:option:
*Optional* The number of days to retain an object version after becoming
*non-current* (i.e. a different version of that object is now the `HEAD`).
MinIO marks noncurrent object versions for deletion after the specified
number of days pass.
This option has the same behavior as the
S3 ``NoncurrentVersionExpiration`` action.
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
.. mc-cmd:: noncurrentversion-transition-days
:option:
*Optional* The number of days an object has been non-current (i.e. replaced
by a newer version of that same object) after which MinIO marks the object
version as eligible for transition. MinIO transitions the object to the
configured remote storage tier specified to the
:mc-cmd-option:`~mc ilm edit storage-class` once the system host datetime
passes that calendar date.
This option has no effect on non-versioned buckets. Requires specifying
:mc-cmd-option:`~mc ilm edit noncurrentversion-transition-storage-class`.
This option has the same behavior as the
S3 ``NoncurrentVersionTransition`` action.
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
.. mc-cmd:: noncurrentversion-transition-storage-class
:option:
*Optional* The remote storage tier to which MinIO
:ref:`transitions noncurrent objects versions
<minio-lifecycle-management-tiering>`. Specify a remote storage tier created
by :mc-cmd:`mc admin tier`.
MinIO does *not* automatically migrate objects from the previously
specified remote tier to the new remote tier. MinIO continues to
route requests for objects stored on the old remote tier.
.. mc-cmd:: tags
:option:
*Optional* One or more ampersand ``&``-delimited key-value pairs describing
the object tags to which to apply the lifecycle configuration rule.
This option is mutually exclusive with the following option:
- :mc-cmd-option:`~mc ilm edit expired-object-delete-marker`
.. mc-cmd:: transition-days
:option:
*Optional* The number of calendar days from object creation after which MinIO
marks an object as eligible for transition. MinIO transitions the object to
the configured remote storage tier specified to the
:mc-cmd-option:`~mc ilm edit storage-class`.
For versioned buckets, the transition rule applies only to the *current*
object version. Use the
:mc-cmd-option:`~mc ilm edit noncurrentversion-transition-days` option
to apply transition behavior to noncurrent object versions.
Requires specifying :mc-cmd-option:`~mc ilm edit storage-class`.
MinIO uses a scanner process to check objects against all configured
lifecycle management rules. Slow scanning due to high IO workloads or
limited system resources may delay application of lifecycle management
rules. See :ref:`minio-lifecycle-management-scanner` for more information.
.. mc-cmd:: storage-class
:option:
*Optional* The remote storage tier to which MinIO
:ref:`transition objects <minio-lifecycle-management-tiering>`. Specify a
remote storage tier created by :mc-cmd:`mc admin tier`.
Required if specifying :mc-cmd-option:`~mc ilm edit transition-days`.
MinIO does *not* automatically migrate objects from the previously
specified remote tier to the new remote tier. MinIO continues to
route requests for objects stored on the old remote tier.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Modify an Existing Lifecycle Management Rule
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc ilm edit` with :mc-cmd-option:`~mc ilm edit id` to modify
an existing object expiration rule:
.. code-block:: shell
:class: copyable
mc ilm edit ALIAS/PATH --id "RULEID" [FLAGS]
- Replace :mc-cmd:`ALIAS <mc ilm edit ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc ilm edit ALIAS>` with the path to the bucket on the
S3-compatible host.
- Replace ``RULEID`` with the unique ID of the object lifecycle management
rule.
- Specify any additional flags to add or modify the lifecycle management
rule. For example, specify
:mc-cmd:`~mc ilm edit transition-days` to override the existing
transition days value for the rule.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,119 @@
.. _minio-mc-ilm-export:
=================
``mc ilm export``
=================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc ilm export
Syntax
------
.. start-mc-ilm-export-desc
The :mc:`mc ilm export` command exports the object lifecycle management
configuration for a MinIO bucket.
.. end-mc-ilm-export-desc
The :mc:`mc ilm export` command outputs to ``STDOUT`` by default. You can
output the contents to a ``.json`` file for archival or ingestion using
:mc:`mc ilm import`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command exports the lifecycle management configuration
of the ``mydata`` bucket on the ``myminio`` deployment to the
``mydata-lifecycle-config.json`` file:
.. code-block:: shell
:class: copyable
mc ilm export myminio/mydata > mydata-lifecycle-config.json
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ilm export ALIAS > STDOUT
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` and full path to the bucket on the MinIO
deployment for which to export object lifecycle management rules. For
example:
.. code-block:: none
mc ilm export myminio/mydata > bucket-lifecycle.json
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Export the Bucket Lifecycle Management Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
The following command exports the bucket lifecycle management
configuration to the ``bucket-lifecycle.json`` file:
.. code-block:: shell
:class: copyable
mc ilm export myminio/mybucket > bucket-lifecycle.json
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc ilm export ALIAS > file.json
- Replace ``ALIAS`` with the :ref:`alias <alias>` of the MinIO
deployment and the bucket for which to export object lifecycle
management rules:
``myminio/mydata``
- Replace ``file.json`` with the name of the file to which to export the
lifecycle management rules.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,126 @@
.. _minio-mc-ilm-import:
=================
``mc ilm import``
=================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc ilm import
Syntax
------
.. start-mc-ilm-import-desc
The :mc:`mc ilm import` command imports an object lifecycle management
configuration and applies it to a MinIO bucket.
.. end-mc-ilm-import-desc
The :mc:`mc ilm import` command imports from ``STDIN`` by default. You can
input the contents from a ``.json`` file, such as one produced by
:mc:`mc ilm export`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command imports the lifecycle management configuration from
``mydata-lifecycle-config.json`` and applies it to the ``mydata`` bucket
on the ``myminio`` deployment:
.. code-block:: shell
:class: copyable
mc ilm import myminio/mydata <> mydata-lifecycle-config.json
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ilm import ALIAS < STDIN
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` and full path to the bucket on the MinIO
deployment into which to import object lifecycle management rules. For
example:
.. code-block:: none
mc ilm import myminio/mydata < bucket-lifecycle.json
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Import the Bucket Lifecycle Management Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Example
The following command imports the bucket lifecycle management
configuration from the ``bucket-lifecycle.json`` file:
.. code-block:: shell
:class: copyable
mc ilm import myminio/mybucket < bucket-lifecycle.json
.. tab-item:: Syntax
.. code-block:: shell
:class: copyable
mc ilm import ALIAS < file.json
- Replace ``ALIAS`` with the :ref:`alias <alias>` of the MinIO
deployment and the bucket into which to import object lifecycle
management rules:
``myminio/mydata``
- Replace ``file.json`` with the name of the file from which to import the
lifecycle management rules.
Behavior
--------
Importing Configuration Overrides Existing Rules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:mc-cmd:`mc ilm import` replaces the current bucket lifecycle management
rules with those defined in the imported JSON configuration.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,116 @@
.. _minio-mc-ilm-ls:
=============
``mc ilm ls``
=============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc ilm ls
Syntax
------
.. start-mc-ilm-ls-desc
The :mc:`mc ilm ls` command lists all configured object lifecycle management
rules on a MinIO bucket.
.. end-mc-ilm-ls-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command lists all lifecycle management rules for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc ilm ls myminio/mydata
.. tab-item:: SYNTAX
The :mc-cmd:`mc ilm ls` command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ilm ls \
[--expiry | --transition] \
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` and full path to the bucket on the MinIO
deployment for which to list the object lifecycle management rules. For
example:
.. code-block:: none
mc ilm ls myminio/mydata
.. mc-cmd:: expiry
:option:
*Optional* :mc-cmd:`mc ilm ls` returns only fields related to lifecycle rule
expiration.
Mutually exclusive with :mc-cmd-option:`~mc ilm ls transition`.
.. mc-cmd:: transition
:option:
*Optional* :mc-cmd:`mc ilm ls` returns only fields related to lifecycle rule
transition.
Mutually exclusive with :mc-cmd-option:`~mc ilm ls expiry`.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List Bucket Lifecycle Management Rules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc ilm ls` to list a bucket's lifecycle management rules:
.. code-block:: shell
:class: copyable
mc ilm ls ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc ilm ls ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc ilm ls ALIAS>` with the path to the bucket on the
S3-compatible host.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,162 @@
.. _minio-mc-ilm-restore:
==================
``mc ilm restore``
==================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc ilm restore
Syntax
------
.. start-mc-ilm-restore-desc
The :mc:`mc ilm restore` command creates a temporary copy of an object archived
on a remote tier. The copy automatically expires after 1 day by default.
.. end-mc-ilm-restore-desc
Use this command to allow applications to access a tiered object through the
MinIO deployment (e.g. "hot tier"). The archived object remains on the remote
tier, while the temporary copy becomes ``HEAD`` for that object.
.. tab-set::
.. tab-item:: EXAMPLE
The following command restores a copy of a transitioned object from the
remote tier back to the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc ilm restore myminio/mybucket/object.txt
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ilm restore \
[--days "int" ] \
[--recursive] \
[--vid "string"] \
[--versions] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The MinIO :ref:`alias <alias>`, bucket, and path to the
archived object to restore.
.. code-block:: shell
mc ilm restore myminio/mybucket/object.txt
.. mc-cmd:: days value
:option:
*Optional* The number of days after which MinIO expires the restored copy
of the archived object.
.. mc-cmd:: recursive, r
:option:
*Optional* Restores all objects under the specified prefix.
.. mc-cmd:: versions
:option:
*Optional* Restores all versions of the object on the remote tier.
.. mc-cmd:: version-id, vid
:option:
*Optional* Restores the specified version of the object on the remote tier.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Restore an Archived Object
~~~~~~~~~~~~~~~~~~~~~~~~~~
The following command restores an object archived to a remote tier:
.. code-block:: shell
:class: copyable
mc ilm restore myminio/mybucket/object.txt
Restore a Specific Archived Object Version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following command restore a specific object version archived to a
remote tier:
.. code-block:: shell
:class: copyable
mc ilm restore --vid "VERSIONID" myminio/mybucket/object.txt
Restore All Archived Objects at a Bucket Prefix
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following command restores all objects archived under a specified prefix on
the remote tier:
.. code-block:: shell
:class: copyable
mc ilm restore --recursive myminio/mybucket/data/
Behavior
--------
Restored Objects Expire Automatically
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO automatically expires the restored object copy after the specified
number of days (Default: 1 day).
Restored Objects Become HEAD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The restored object copy becomes HEAD for that object namespace *regardless*
of it's versioning history. This can result in applications returning
"stale" data while the local copy exists.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,122 @@
.. _minio-mc-ilm-rm:
=============
``mc ilm rm``
=============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc ilm rm
Syntax
------
.. start-mc-ilm-rm-desc
The :mc:`mc ilm rm` command removes an object lifecycle management rule from a
MinIO Bucket.
.. end-mc-ilm-rm-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes a single lifecycle management rule from
the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc ilm rm --id "bgrt1ghju" myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ilm rm \
--id "string" | (--all --force) \
ALIAS \
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` and full path to the bucket on the MinIO
deployment to which to remove the object lifecycle management rule. For
example:
.. code-block:: none
mc ilm rm myminio/mydata
.. mc-cmd:: all
*Required* Removes all rules in the bucket. Mutually exclusive with
:mc-cmd-option:`mc ilm rm id`.
Mutually exclusive with :mc-cmd-option:`mc ilm rm id`
Requires including :mc-cmd-option:`~mc ilm rm force`.
.. mc-cmd:: force
Required if specifying :mc-cmd-option:`~mc ilm rm all`.
.. mc-cmd:: id
*Required* The unique ID of the rule. Use :mc-cmd:`mc ilm ls` to list bucket
rules and retrieve the ``id`` for the rule you want to remove.
Mutually exclusive with :mc-cmd-option:`mc ilm rm all`
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Remove a Bucket Lifecycle Management Rule
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc ilm rm` to remove a bucket lifecycle management rule:
.. code-block:: shell
:class: copyable
mc ilm rm --id "RULE" ALIAS/PATH
- Replace :mc-cmd:`RULE <mc ilm rm id>` with the unique name of the lifecycle
management rule.
- Replace :mc-cmd:`ALIAS <mc ilm rm ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc ilm rm ALIAS>` with the path to the bucket on the
S3-compatible host.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,135 @@
.. _minio-mc-legalhold-clear:
======================
``mc legalhold clear``
======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc legalhold clear
.. |command| replace:: :mc-cmd:`mc legalhold clear`
.. |rewind| replace:: :mc-cmd-option:`~mc legalhold clear rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc legalhold clear version-id`
.. |alias| replace:: :mc-cmd-option:`~mc legalhold clear ALIAS`
Syntax
------
.. start-mc-legalhold-clear-desc
The :mc:`mc legalhold clear` command removes the current :ref:`legal hold
<minio-object-locking-legalhold>` setting for an object or objects.
.. end-mc-legalhold-clear-desc
Removing the legal hold on object(s) does *not* remove any other
:ref:`minio-object-locking-governance` and
:ref:`minio-object-locking-compliance` retention settings in place for
the object(s)
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes the legal hold on all objects in the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc legalhold clear --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] legalhold clear \
[--recursive] \
[--rewind] \
[--version-id] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The MinIO :ref:`alias <alias>` and path to the object or
objects on which to remove the legal hold. For example:
.. code-block:: shell
mc legalhold clear play/mybucket/myobjects/objects.txt
.. mc-cmd:: recursive, r
:option:
Removes the legal hold on all objects in the
:mc-cmd:`~mc legalhold clear ALIAS` bucket or bucket prefix.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Retrieve the Legal Hold Status Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc legalhold clear` to retrieve the legal hold status of an object.
Include :mc-cmd-option:`~mc legalhold clear recursive` to return the legal hold
status of the contents of a bucket:
.. code-block:: shell
:class: copyable
mc legalhold clear [--recursive] ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc legalhold clear ALIAS>` with the
:ref:`alias <alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc legalhold clear ALIAS>` with the path to the bucket
or object on the S3-compatible host. If specifying the path to a bucket or
bucket prefix, include the :mc-cmd-option:`~mc legalhold clear recursive`
option.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,135 @@
.. _minio-mc-legalhold-info:
=====================
``mc legalhold info``
=====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc legalhold info
.. |command| replace:: :mc-cmd:`mc legalhold info`
.. |rewind| replace:: :mc-cmd-option:`~mc legalhold info rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc legalhold info version-id`
.. |alias| replace:: :mc-cmd-option:`~mc legalhold info ALIAS`
Syntax
------
.. start-mc-legalhold-info-desc
The :mc:`mc legalhold info` command returns the current :ref:`legal hold
<minio-object-locking-legalhold>` setting for an object or objects.
.. end-mc-legalhold-info-desc
:mc:`mc legalhold` *requires* that the specified bucket has object locking
enabled. You can **only** enable object locking at bucket creation. See
:mc-cmd-option:`mc mb with-lock` for documentation on creating buckets with
object locking enabled.
.. tab-set::
.. tab-item:: EXAMPLE
The following command retrieves the current legalhold status for objects
in the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc legalhold info --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] legalhold info \
[--recursive] \
[--rewind] \
[--version-id] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The MinIO :ref:`alias <alias>` and path to the object or
objects on which to enable the legal hold. For example:
.. code-block:: shell
mc legalhold info play/mybucket/myobjects/objects.txt
.. mc-cmd:: recursive, r
:option:
Returns the legal hold status of all objects in the
:mc-cmd:`~mc legalhold info ALIAS` bucket or bucket prefix.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Retrieve the Legal Hold Status Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc legalhold info` to retrieve the legal hold status of an object.
Include :mc-cmd-option:`~mc legalhold info recursive` to return the legal hold
status of the contents of a bucket:
.. code-block:: shell
:class: copyable
mc legalhold clear [--recursive] ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc legalhold info ALIAS>` with the
:ref:`alias <alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc legalhold info ALIAS>` with the path to the bucket
or object on the S3-compatible host. If specifying the path to a bucket or
bucket prefix, include the :mc-cmd-option:`~mc legalhold info recursive`
option.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,149 @@
.. _minio-mc-legalhold-set:
====================
``mc legalhold set``
====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc legalhold
.. mc:: mc legalhold set
.. |command| replace:: :mc-cmd:`mc legalhold set`
.. |rewind| replace:: :mc-cmd-option:`~mc legalhold set rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc legalhold set version-id`
.. |alias| replace:: :mc-cmd-option:`~mc legalhold set ALIAS`
Syntax
------
.. start-mc-legalhold-set-desc
The :mc:`mc legalhold set` command enables :ref:`legal hold
<minio-object-locking-legalhold>` Write-Once Read-Many (WORM) object locking on
an object or objects.
.. end-mc-legalhold-set-desc
:mc:`mc legalhold` *requires* that the specified bucket has
:ref:`object locking enabled <minio-object-locking>`. You can **only** enable
object locking at bucket creation. See :mc-cmd-option:`mc mb with-lock` for
documentation on creating buckets with object locking enabled.
.. tab-set::
.. tab-item:: EXAMPLE
The following command enables legalhold WORM locking on all objects
in the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc legalhold set --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] legalhold set \
[--recursive] \
[--rewind] \
[--version-id] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The MinIO :ref:`alias <alias>` and path to the object or
objects on which to enable the legal hold. For example:
.. code-block:: shell
mc legalhold set play/mybucket/myobjects/objects.txt
.. mc-cmd:: recursive, r
:option:
*Optional* Applies the legal hold to all objects in the
:mc-cmd:`~mc legalhold set ALIAS` bucket or bucket prefix.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Use :mc-cmd:`mc legalhold set` to enable legal hold on objects:
.. code-block:: shell
:class: copyable
mc legalhold set [--recursive] ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc legalhold set ALIAS>` with the
:ref:`alias <alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc legalhold set ALIAS>` with the path to the bucket
or object on the S3-compatible host. If specifying the path to a bucket or
bucket prefix, include the :mc-cmd-option:`~mc legalhold set recursive`
option.
Behavior
--------
Legal Holds Require Explicit Removal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Legal Holds are indefinite and enforce complete immutability for locked objects.
Only privileged users with the :policy-action:`s3:PutObjectLegalHold` can set or
lift the Legal Hold.
Legal Holds Complement Other Retention Modes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Legal holds are complementary to both :ref:`minio-object-locking-governance` and
:ref:`minio-object-locking-compliance` retention settings. An object held under
both legal hold *and* a ``GOVERNANCE/COMPLIANCE`` retention rule remains WORM
locked until the legal hold is lifed *and* the rule expires.
For ``GOVERNANCE`` locked objects, the legal hold prevents mutating the object
*even if* the user has the necessary privileges to bypass retention.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,215 @@
=========
``mc ls``
=========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc ls
.. Replacement substitutions
.. |command| replace:: :mc-cmd:`mc ls`
.. |rewind| replace:: :mc-cmd-option:`~mc ls rewind`
.. |versions| replace:: :mc-cmd-option:`~mc ls versions`
.. |alias| replace:: :mc-cmd-option:`~mc ls ALIAS`
Syntax
------
.. start-mc-ls-desc
The :mc:`mc ls` command lists buckets and objects on MinIO or another
S3-compatible service.
.. end-mc-ls-desc
You can also use :mc:`mc ls` against the local filesystem to produce similar
results as the ``ls`` command.
.. tab-set::
.. tab-item:: EXAMPLE
The following command lists all objects *and* object versions in the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc ls --recursive --versions myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ls \
[--incomplete] \
[--recursive] \
[--rewind] \
[--versions] \
[--summarize] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The object or objects to copy.
For listing objects on MinIO or another S3-compatible service,
specify the :ref:`alias <alias>` and the full path to that
object (e.g. bucket and path to object). For example:
.. code-block:: none
mc ls play/mybucket/object.txt
For listing objects on a local filesystem, specify the full
path to that object. For example:
.. code-block:: none
mc ls ~/mydata/object.txt
If you specify a directory or bucket to :mc-cmd:`~mc ls ALIAS`, you must
also specify :mc-cmd-option:`~mc ls recursive` to recursively list the
contents of that directory or bucket. If you omit the ``--recursive``
argument, :mc:`~mc ls` only lists objects in the top level of the specified
directory or bucket.
.. mc-cmd:: incomplete, -I
:option:
*Optional* Returns any incomplete uploads on the specified
:mc-cmd:`~mc ls ALIAS` bucket.
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively lists the contents of each bucket or directory in the
:mc-cmd:`~mc ls ALIAS`.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
Use :mc-cmd-option:`~mc ls rewind` and
:mc-cmd-option:`~mc ls versions` together to display on those object
versions which existed at a specific point in time.
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc ls versions` and
:mc-cmd-option:`~mc ls rewind` together to display on those object
versions which existed at a specific point in time.
.. mc-cmd:: summarize
:option:
*Optional* Displays summarized information for the specified ``ALIAS`` path.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List Bucket Contents
~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc ls <mc ls ALIAS>` to list the contents of a bucket:
.. code-block:: shell
:class: copyable
mc ls [--recursive] ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc ls ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc ls ALIAS>` with the path to the bucket on the
S3-compatible host.
If specifying the path to the S3 root (``ALIAS`` only), include the
:mc-cmd-option:`~mc ls recursive` option.
List Object Versions
~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc ls versions` to list all versions of an object:
.. code-block:: shell
:class: copyable
mc ls --versions ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc ls ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc ls ALIAS>` with the path to the bucket or object on
the S3-compatible host.
.. include:: /includes/facts-versioning.rst
:start-after: start-versioning-admonition
:end-before: end-versioning-admonition
List Bucket Contents at Point in Time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc ls versions` to list all versions of an object:
.. code-block:: shell
:class: copyable
mc ls --rewind DURATION ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc ls ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc ls ALIAS>` with the path to the bucket or object on
the S3-compatible host.
- Replace :mc-cmd:`DURATION <mc ls rewind>` with the point-in-time in the past
at which the command returns the object. For example, specify ``30d`` to
return the version of the object 30 days prior to the current date.
.. include:: /includes/facts-versioning.rst
:start-after: start-versioning-admonition
:end-before: end-versioning-admonition
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,164 @@
=========
``mc mb``
=========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc mb
Syntax
------
.. start-mc-mb-desc
The :mc:`mc mb` command creates a new bucket or directory at the
specified path.
.. end-mc-mb-desc
You can also use :mc:`mc mb` against the local filesystem to produce
similar results to the ``mkdir -p`` commandline tool.
.. tab-set::
.. tab-item:: EXAMPLE
The following command creates a new bucket ``mydata`` on the
``myminio`` MinIO deployment. The command creates the bucket
with :ref:`object locking enabled <minio-object-locking>`.
.. code-block:: shell
:class: copyable
mc mb --with-locks myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] mb \
[--ignore-existing] \
[--region "string"] \
[--with-lock] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The MinIO or other S3-compatible service on which to create the
new bucket.
For creating a bucket on MinIO or another S3-compatible service, specify the
:ref:`alias <alias>` and the name of the bucket. For example:
.. code-block:: none
mc mb play/mybucket
For creating a directory on a local filesystem, specify the full
path to that directory. For example:
.. code-block:: none
mc ls ~/mydata/object.txt
.. mc-cmd:: ignore-existing, p
:option:
Directs :mc-cmd:`mc mb` to do nothing if the bucket or directory already
exists.
.. mc-cmd:: region
:option:
The region in which to create the specified bucket. Has no effect if the
specified :mc-cmd:`~mc mb ALIAS` is a filesystem directory.
.. mc-cmd:: with-lock, l
:option:
Enables :ref:`object locking <minio-object-locking>` on the specified
bucket. Has no effect if the specified ``ALIAS`` is a
:ref:`standalone <minio-installation-comparison>` MinIO deployments *or*
a filesystem directory.
.. important::
You can *only* enable object locking when creating the bucket.
Buckets created without object locking cannot use
:ref:`Bucket Lifecycle Management <minio-lifecycle-management>` or
:ref:`Bucket Object Locking <minio-object-locking>` functionality.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Create Bucket
~~~~~~~~~~~~~
Use :mc:`mc mb` to create a bucket on an S3-compatible host. The
:mc-cmd-option:`~mc mb with-lock` option creates the bucket with locking
enabled:
.. code-block:: shell
:class: copyable
mc mb --with-lock ALIAS/BUCKET
- Replace :mc-cmd:`ALIAS <mc mb ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`BUCKET <mc mb ALIAS>` with the bucket to create.
Behavior
--------
Bucket Limits for Non-MinIO S3 Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Certain S3 services may restrict the number of buckets a given user or account
can create. For example, Amazon S3 limits each account to
:s3-docs:`100 buckets <BucketRestrictions.html>`. :mc:`mc mb` may return an
error if the user has reached bucket limits on the target S3 service.
MinIO Object Storage deployments do not place any limits on the number of
buckets each user can create.
Enable Object Locking at Bucket Creation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO follows
:s3-docs:`AWS S3 behavior <object-lock-overview.html#object-lock-bucket-config>`
where you *must* enable :ref:`object locking <minio-object-locking>` at
bucket creation. Buckets created without object can *never* enable object
retention or locking.
Enabling bucket locking does *not* set any object locking or retention settings.
Consider enabling bucket locking as standard practice.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,326 @@
=============
``mc mirror``
=============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc mirror
Syntax
------
.. start-mc-mirror-desc
The :mc:`mc mirror` command synchronizes content to MinIO deployment, similar to
the ``rsync`` utility. :mc:`mc mirror` supports filesystems, MinIO deployments,
and other S3-compatible hosts as the synchronization source.
.. end-mc-mirror-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command synchronizes content from a local filesystem
directory to the ``mydata`` bucket on the ``myminio`` MinIO deployment.
.. code-block:: shell
:class: copyable
mc mirror --watch ~/mydata myminio/mydata
The command "watches" the local filesystem and synchronizes any additional
operations to MinIO until explicitly terminated from the terminal:
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] mirror \
[--attr "string"] \
[--disable-multipart] \
[--encrypt-key "string"] \
[--exclude "string"] \
[--fake] \
[--md5] \
[--monitoring-address "string"] \
[--newer-than "string"] \
[--older-than "string"] \
[--preserve] \
[--region "string"] \
[--remove] \
[--storage-class "string"] \
[--watch] \
SOURCE \
TARGET
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: SOURCE
*REQUIRED* The file(s) or object(s) to synchronize to the
:mc-cmd:`~mc mirror TARGET` S3 host.
For objects on S3-compatible hosts, specify the path to the object as
``ALIAS/PATH``, where:
- ``ALIAS`` is the :mc:`alias <mc alias>` of a configured S3-compatible host,
*and*
- ``PATH`` is the path to the bucket or object. If specifying a bucket,
:mc:`mc mirror` synchronizes all objects in the bucket.
.. code-block:: shell
mc mirror [FLAGS] play/mybucket/ myminio/mybucket
For files on a filesystem, specify the full filesystem path to the file or
directory :
.. code-block:: shell
mc mirror [FLAGS] ~/data/ myminio/mybucket
If specifying a directory, :mc-cmd:`mc mirror` synchronizes all files in the
directory.
.. mc-cmd:: TARGET
*REQUIRED* The full path to bucket in which :mc:`mc mirror` copies
synchronized SOURCE objects. Specify the ``TARGET`` as
``ALIAS/PATH``, where:
- ``ALIAS`` is the :mc:`alias <mc alias>` of a configured S3-compatible
host, *and*
- ``PATH`` is the path to the bucket.
.. code-block:: shell
mc mirror SOURCE play/mybucket
:mc:`mc mirror` uses the object or file names from the
:mc-cmd:`~mc mirror SOURCE` when synchronizing to the ``TARGET`` bucket.
.. mc-cmd:: attr
:option:
Add custom metadata for mirrored objects. Specify key-value pairs as
``KEY=VALUE\;``. For example,
``--attr key1=value1\;key2=value2\;key3=value3``.
.. mc-cmd:: disable-multipart
:option:
Disables multipart upload for the copy session.
.. mc-cmd:: encrypt-key
:option:
Encrypt or decrypt objects using server-side encryption with
client-specified keys. Specify key-value pairs as ``KEY=VALUE``.
- Each ``KEY`` represents a bucket or object.
- Each ``VALUE`` represents the data key to use for encrypting
object(s).
Enclose the entire list of key-value pairs passed to
:mc-cmd-option:`~mc mirror encrypt-key` in double quotes ``"``.
:mc-cmd-option:`~mc mirror encrypt-key` can use the ``MC_ENCRYPT_KEY``
environment variable for retrieving a list of encryption key-value pairs
as an alternative to specifying them on the command line.
You can only delete encrypted objects if you specify the correct
:mc-cmd-option:`~mc mirror encrypt-key` secret key.
.. mc-cmd:: exclude
:option:
Exclude object(s) in the :mc-cmd:`~mc mirror SOURCE` path that
match the specified object name pattern.
.. mc-cmd:: fake
:option:
Perform a fake mirror operation. Use this operation to perform
validate that the :mc:`mc mirror` operation will only
mirror the desired objects or buckets.
.. mc-cmd:: md5
:option:
Forces all uploads to calculate MD5 checksums.
.. mc-cmd:: monitoring-address
:option:
Creates a `Prometheus <https://prometheus.io/>`__ endpoint for monitoring
mirroring activity. Specify the local network adapter and port address on
which to create the scraping endpoint. Defaults to ``localhost:8081``).
.. mc-cmd:: newer-than
:option:
Mirror object(s) newer than the specified number of days. Specify a
string in ``#d#hh#mm#ss`` format. For example:
``--older-than 1d2hh3mm4ss``.
.. mc-cmd:: older-than
:option:
Mirror object(s) older than the specified time limit. Specify a string
in ``#d#hh#mm#ss`` format. For example: ``--older-than 1d2hh3mm4ss``.
Defaults to ``0`` (all objects).
.. mc-cmd:: overwrite
:option:
Overwrites object(s) on the :mc-cmd:`~mc mirror TARGET`.
.. mc-cmd:: preserve, a
:option:
Preserve file system attributes and bucket policy rules of the
:mc-cmd:`~mc mirror SOURCE` on the
:mc-cmd:`~mc mirror TARGET`.
.. mc-cmd:: region
:option:
Specify the ``string`` region when creating new bucket(s) on the
target.
Defaults to ``"us-east-1"``.
.. mc-cmd:: remove
:option:
Removes extraneous object(s) on the target.
.. mc-cmd:: storage-class, sc
:option:
Set the storage class for the new object(s) on the
:mc-cmd:`~mc mirror TARGET`.
See the Amazon documentation on
:aws-docs:`Storage Classes <AmazonS3/latest/dev/storage-class-intro.html>`
for more information on S3 storage classses.
.. mc-cmd:: watch, w
:option:
Continuously monitor the :mc-cmd:`~mc mirror SOURCE` path and
synchronize changes.
Defaults to ``0`` (all objects).
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Mirror a Local Directory to an S3-Compatible Host
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc mirror` to mirror files from a filesystem to an S3 Host:
.. code-block::
:class: copyable
mc mirror FILEPATH ALIAS/PATH
- Replace :mc-cmd:`FILEPATH <mc mirror SOURCE>` with the full file path to the
directory to mirror.
- Replace :mc-cmd:`ALIAS <mc mirror TARGET>` with the :mc-cmd:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc mirror TARGET>` with the destination bucket.
Continuously Mirror a Local Directory to an S3-Compatible Host
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc mirror` with :mc-cmd-option:`~mc mirror watch` to continuously mirror
files from a filesystem to an S3-compatible host:
.. code-block::
:class: copyable
mc mirror FILEPATH ALIAS/PATH
- Replace :mc-cmd:`FILEPATH <mc mirror SOURCE>` with the full file path to the
directory to mirror.
- Replace :mc-cmd:`ALIAS <mc mirror TARGET>` with the :mc-cmd:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc mirror TARGET>` with the destination bucket.
Continuously Mirror S3 Bucket to an S3-Compatible Host
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc mirror` with :mc-cmd-option:`~mc mirror watch` to continuously
mirror objects in a bucket on one S3-compatible host to another S3-compatible
host.
.. code-block::
:class: copyable
mc mirror --watch SRCALIAS/SRCPATH TGTALIAS/TGTPATH
- Replace :mc-cmd:`SRCALIAS <mc mirror SOURCE>` with :mc-cmd:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`SRCPATH <mc mirror SOURCE>` with the bucket to mirror.
- Replace :mc-cmd:`TGTALIAS <mc mirror TARGET>` with the
:mc-cmd:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`TGTPATH <mc mirror TARGET>` with the destination bucket.
Behavior
--------
MinIO Trims Empty Prefixes on Object Removal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The :mc-cmd-option:`mc mirror watch` command continuously synchronizes the
source and destination targets. This includes automatically removing objects
on the destination if they are removed on the source.
.. |command| replace:: :mc-cmd-option:`mc mirror watch`
.. include:: /includes/common-admonitions.rst
:start-after: start-remove-api-trims-prefixes
:end-before: end-remove-api-trims-prefixes
.. include:: /includes/common-admonitions.rst
:start-after: start-remove-api-trims-prefixes-fs
:end-before: end-remove-api-trims-prefixes-fs
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,368 @@
=========
``mc mv``
=========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc mv
Syntax
------
.. start-mc-mv-desc
The :mc:`mc mv` command moves an object from source to the target, such as
between MinIO deployments *or* between buckets on the same MinIO deployment.
:mc:`mc mv` also supports moving objects between a local filesystem and MinIO.
.. end-mc-mv-desc
You can also use :mc:`mc mv` against the local filesystem to produce
similar results to the ``mv`` commandline tool.
.. tab-set::
.. tab-item:: EXAMPLE
The following command moves objects from the ``mydata`` bucket to the
``archive`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc mv --recursive myminio/mydata myminio/archive
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] mv \
[--attr "string"] \
[--continue] \
[--encrypt "string"] \
[--encrypt-key "string"] \
[--newer-than "string"] \
[--older-than "string"] \
[--preserve] \
[--recursive] \
[--storage-class "string"] \
SOURCE \
TARGET
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: SOURCE
*Required* The object or objects to move.
For moving an object from MinIO or another S3-compatible service,
specify the :ref:`alias <alias>` and hte full path to the object(s)
(e.g. bucket and path to objects). For example:
.. code-block:: shell
mc mv play/mybucket/object.txt play/myotherbucket/object.txt
For moving an object from a local filesystem, specify the full path to that
object. For example:
.. code-block:: shell
mc mv ~/mydata/object.txt play/mybucket/object.txt
You can specify both local paths
and S3 paths using a configured S3 service :mc:`alias <mc alias>`.
If you specify a directory or bucket to :mc-cmd:`~mc mv SOURCE`, you must
also specify :mc-cmd-option:`~mc mv recursive` to recursively move the
contents of that directory. If you omit the :mc-cmd-option:`~mc mv recursive`
argument, :mc:`~mc mv` only moves objects in the top level of the specified
directory or bucket.
.. mc-cmd:: TARGET
*Required* The full path to the bucket to which the command moves the
object(s) at the specified :mc-cmd:`~mc mv SOURCE`. Specify the
:ref:`alias <alias>` of a configured S3 service as the prefix to the
:mc-cmd:`~mc mv TARGET` path.
For moving an object from MinIO or another S3-compatible service,
specify the :ref:`alias <alias>` and hte full path to the object(s)
(e.g. bucket and path to objects). For example:
.. code-block:: shell
mc mv play/mybucket/object.txt play/myotherbucket/object.txt
For moving an object from a local filesystem, specify the full path to that
object. For example:
.. code-block:: shell
mc mv ~/mydata/object.txt play/mybucket/object.txt
The ``TARGET`` object name can differ from the ``SOURCE`` to
"rename" the object as part of the move operation.
If running :mc-cmd:`mc mv` with the :mc-cmd-option:`~mc mv recursive` option,
:mc-cmd:`mc mv` treats the ``TARGET`` as the bucket prefix for all
objects at the ``SOURCE``.
.. mc-cmd:: attr
:option:
*Optional* Add custom metadata for the object. Specify key-value pairs as
``KEY=VALUE\;``. For example,
``--attr key1=value1\;key2=value2\;key3=value3``.
.. mc-cmd:: continue, c
:option:
*Optional* Create or resume a move session.
.. mc-cmd:: encrypt
:option:
*Optional* Encrypt or decrypt objects using server-side encryption with
server-managed keys. Specify key-value pairs as ``KEY=VALUE``.
- Each ``KEY`` represents a bucket or object.
- Each ``VALUE`` represents the data key to use for encrypting
object(s).
Enclose the entire list of key-value pairs passed to
:mc-cmd-option:`~mc mv encrypt` in double-quotes ``"``.
:mc-cmd-option:`~mc mv encrypt` can use the ``MC_ENCRYPT`` environment
variable for retrieving a list of encryption key-value pairs as an
alternative to specifying them on the command line.
.. mc-cmd:: encrypt-key
:option:
*Optional* Encrypt or decrypt objects using server-side encryption with
client-specified keys. Specify key-value pairs as ``KEY=VALUE``.
- Each ``KEY`` represents a bucket or object.
- Each ``VALUE`` represents the data key to use for encrypting
object(s).
Enclose the entire list of key-value pairs passed to
:mc-cmd-option:`~mc mv encrypt-key` in double quotes ``"``.
:mc-cmd-option:`~mc mv encrypt-key` can use the ``MC_ENCRYPT_KEY``
environment variable for retrieving a list of encryption key-value pairs
as an alternative to specifying them on the command line.
.. mc-cmd:: newer-than
:option:
*Optional* Remove object(s) newer than the specified number of days. Specify
a string in ``##d#hh#mm#ss`` format. For example:
``--newer-than 1d2hh3mm4ss``.
Defaults to ``0`` (all objects).
.. mc-cmd:: older-than
:option:
*Optional* Remove object(s) older than the specified time limit. Specify a
string in ``#d#hh#mm#ss`` format. For example: ``--older-than 1d2hh3mm4ss``.
Defaults to ``0`` (all objects).
.. mc-cmd:: preserve, a
:option:
*Optional* Preserve file system attributes and bucket policy rules of the
:mc-cmd:`~mc mv SOURCE` directories, buckets, and objects on the
:mc-cmd:`~mc mv TARGET` bucket(s).
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively move the contents of each bucket or directory
:mc-cmd:`~mc mv SOURCE` to the :mc-cmd:`~mc mv TARGET` bucket.
.. mc-cmd:: storage-class, sc
:option:
*Optional* Set the storage class for the new object(s) on the
:mc-cmd:`~mc mv TARGET`.
See the Amazon documentation on
:aws-docs:`Storage Classes <AmazonS3/latest/dev/storage-class-intro.html>`
for more information on S3 storage classses.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Move Files from Filesystem to S3-Compatible Host
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: shell
:class: copyable
mc mv [--recursive] FILEPATH ALIAS/PATH
- Replace :mc-cmd:`FILEPATH <mc mv SOURCE>` with the full file path to the
file to move.
If specifying the path to a directory, include the
:mc-cmd-option:`~mc mv recursive` flag.
:mc:`mc mv` *removes* the files from the source after
successfully moving it to the destination.
- Replace :mc-cmd:`ALIAS <mc mv TARGET>` with the :mc-cmd:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc mv TARGET>` with the destination bucket.
Move a File from Filesystem to S3-Compatible Host with Custom Metadata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc mv` with the :mc-cmd-option:`~mc mv attr` option to set custom
attributes on file(s).
.. code-block:: shell
:class: copyable
mc mv --attr "ATTRIBUTES" FILEPATH ALIAS/PATH
- Replace :mc-cmd:`FILEPATH <mc mv SOURCE>` with the full file path to the
file to move. :mc:`mc mv` *removes* the file from the source after
successfully moving it to the destination.
- Replace :mc-cmd:`ALIAS <mc mv TARGET>` with the :mc-cmd:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc mv TARGET>` with the destination bucket.
- Replace :mc-cmd:`ATTRIBUTES <mc mv attr>` with one or more comma-separated
key-value pairs ``KEY=VALUE``. Each pair represents one attribute key and
value.
Move Bucket Between S3-Compatible Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: shell
:class: copyable
mc mv --recursive SRCALIAS/SRCPATH TGTALIAS/TGTPATH
- Replace :mc-cmd:`SRCALIAS <mc mv SOURCE>` with the :mc-cmd:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`SRCPATH <mc mv SOURCE>` with the path to the bucket.
:mc:`mc mv` *removes* the bucket and its contents from the source after
successfully moving it to the destination.
- Replace :mc-cmd:`TGTALIAS <mc mv TARGET>` with the :mc-cmd:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`TGTPATH <mc mv TARGET>` with the path to the bucket.
Move File to S3-Compatible Host with Specific Storage Class
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc mv` with the :mc-cmd-option:`~mc mv storage-class` option to set
the storage class on the destination S3-compatible host.
.. code-block:: shell
:class: copyable
mc mv --storage-class CLASS FILEPATH ALIAS/PATH
- Replace :mc-cmd:`CLASS <mc mv storage-class>` with the storage class to
associate to the files.
- Replace :mc-cmd:`FILEPATH <mc mv SOURCE>` with the full file path to the
file to move. :mc:`mc mv` *removes* the file from the source after
successfully moving it to the destination.
- Replace :mc-cmd:`ALIAS <mc mv TARGET>` with the :mc-cmd:`alias <mc alias>`
of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc mv TARGET>` with the destination bucket.
- Replace :mc-cmd:`ATTRIBUTES <mc mv attr>` with one or more comma-separated
key-value pairs ``KEY=VALUE``. Each pair represents one attribute key and
value.
mc mv --storage-class REDUCED_REDUNDANCY myobject.txt play/mybucket
Behavior
~~~~~~~~
Object Names on Move
~~~~~~~~~~~~~~~~~~~~
MinIO uses the :mc-cmd-option:`~mc mv SOURCE` object name when moving
the object to the :mc-cmd-option:`~mc mv TARGET` if no explicit target
object name is specified.
You can specify a different object name for the
:mc-cmd-option:`~mc mv TARGET` with the same object path to "rename"
an object. For example:
.. code-block:: shell
mc mv play/mybucket/object.txt play/mybucket/myobject.txt
For recursive move operations (:mc-cmd-option:`mc mv recursive`), MinIO
treats the ``TARGET`` path as a prefix for objects on the ``SOURCE``.
Checksum Verification
~~~~~~~~~~~~~~~~~~~~~
:mc:`mc mv` verifies all move operations to object storage using MD5SUM
checksums.
Resume Move Operations
~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd-option:`mc mv continue` to resume an interrupted or failed
move operation from the point of failure.
MinIO Trims Empty Prefixes on Object Removal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. |command| replace:: :mc-cmd:`mc mv`
.. include:: /includes/common-admonitions.rst
:start-after: start-remove-api-trims-prefixes
:end-before: end-remove-api-trims-prefixes
.. include:: /includes/common-admonitions.rst
:start-after: start-remove-api-trims-prefixes-fs
:end-before: end-remove-api-trims-prefixes-fs
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,104 @@
.. _minio-mc-policy-get-json:
======================
``mc policy get-json``
======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc policy get-json
Syntax
------
.. start-mc-policy-get-json-desc
The :mc:`mc policy get-json` command gets anonymous (i.e. unauthenticated or
public) access :ref:`policies <minio-policy>` for a bucket.
.. end-mc-policy-get-json-desc
Buckets with anonymous policies allow clients to access the bucket contents
and perform actions consistent with the specified policy without
:ref:`authentication <minio-authentication-and-identity-management>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command retrieves the JSON-formatted anonymous
policy for the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc policy get-json myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] get-json ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The full path to the bucket or bucket prefix for which to get the
anonymous bucket policy.
Specify the :ref:`alias <alias>` of the MinIO or other
S3-compatible service *and* the full path to the bucket or bucket
prefix. For example:
.. code-block:: shell
mc get-json public play/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Get Anonymous Policy for Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc policy get-json` to get the anonymous policy for a
bucket:
.. code-block:: shell
:class: copyable
mc policy get-json ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc policy get-json ALIAS>` with the
:mc-cmd:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc policy get-json ALIAS>` with the destination bucket.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,108 @@
.. _minio-mc-policy-get:
=================
``mc policy get``
=================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc policy get
Syntax
------
.. start-mc-policy-get-desc
The :mc:`mc policy get` command gets the anonymous (i.e. unauthenticated or
public) access :ref:`policies <minio-policy>` for a bucket.
.. end-mc-policy-get-desc
Buckets with anonymous policies allow clients to access the bucket contents
and perform actions consistent with the specified policy without
:ref:`authentication <minio-authentication-and-identity-management>`.
To get the :s3-docs:`JSON policy <using-iam-policies>` assigned to the bucket,
use the :mc-cmd:`mc policy get-json` command.
.. tab-set::
.. tab-item:: EXAMPLE
The following command retrieves the anonymous access policy for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc policy get myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] policy get ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The full path to the bucket or bucket prefix for which the
command retrieves the anonymous bucket policy.
Specify the :ref:`alias <alias>` of the MinIO or other
S3-compatible service *and* the full path to the bucket or bucket
prefix. For example:
.. code-block:: shell
mc get public play/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Get Anonymous Policy for Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc policy get` to get the anonymous policy for a
bucket:
.. code-block:: shell
:class: copyable
mc policy get ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc policy get ALIAS>` with the
:mc-cmd:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc policy get ALIAS>` with the destination bucket.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,111 @@
.. _minio-mc-policy-links:
===================
``mc policy links``
===================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc policy links
Syntax
------
.. start-mc-policy-links-desc
The :mc:`mc policy links` retrieves the HTTP URL for anonymous (i.e.
unauthenticated or public) access to a bucket.
.. end-mc-policy-links-desc
Buckets with anonymous policies allow clients to access the bucket contents
and perform actions consistent with the specified policy without
:ref:`authentication <minio-authentication-and-identity-management>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command retrieves HTTP URLs for the ``mydata`` bucket
on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc policy links --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] policy links \
[--recursive] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The full path to the bucket or bucket prefix for which the
command retrieves the anonymous bucket policies.
Specify the :ref:`alias <alias>` of the MinIO or other
S3-compatible service *and* the full path to the bucket or bucket
prefix. For example:
.. code-block:: shell
mc links public [FLAGS] play/mybucket
.. mc-cmd:: recursive
:option:
*Optional* Retrieve the HTTP links recursively.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List Anonymous Policies for Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc policy links` to links the anonymous policies for a
bucket:
.. code-block:: shell
:class: copyable
mc policy links ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc policy get ALIAS>` with the
:mc-cmd:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc policy get ALIAS>` with the destination bucket.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,105 @@
.. _minio-mc-policy-list:
==================
``mc policy list``
==================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc policy list
Syntax
------
.. start-mc-policy-list-desc
The :mc:`mc policy list` retrieves all anonymous (i.e. unauthenticated or
public) access policies for a bucket.
.. end-mc-policy-list-desc
Buckets with anonymous policies allow clients to access the bucket contents
and perform actions consistent with the specified policy without
:ref:`authentication <minio-authentication-and-identity-management>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command lists all anonymous access policies for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc policy list myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The full path to the bucket or bucket prefix for which the
command retrieves the anonymous bucket policies.
Specify the :ref:`alias <alias>` of the MinIO or other
S3-compatible service *and* the full path to the bucket or bucket
prefix. For example:
.. code-block:: shell
mc list public play/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List Anonymous Policies for Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc policy list` to list the anonymous policies for a
bucket:
.. code-block:: shell
:class: copyable
mc policy list ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc policy get ALIAS>` with the
:mc-cmd:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc policy get ALIAS>` with the destination bucket.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,130 @@
.. _minio-mc-policy-set-json:
======================
``mc policy set-json``
======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc policy set-json
Syntax
------
.. start-mc-policy-set-json-desc
The :mc:`mc policy set-json` command sets anonymous (i.e. unauthenticated or
public) access :ref:`policies <minio-policy>` for a bucket using using an IAM
:s3-docs:`JSON policy document <using-iam-policies>`.
.. end-mc-policy-set-json-desc
Buckets with anonymous policies allow clients to access the bucket contents
and perform actions consistent with the specified policy without
:ref:`authentication <minio-authentication-and-identity-management>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command applies the JSON-formatted anonymous policy
to the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc policy set-json ~/mydata-anonymous.json myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] set-json POLICY ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: POLICY
*Required* The path to the JSON-formatted policy to assign to the specified
``ALIAS``.
.. mc-cmd:: ALIAS
*Required* The full path to the bucket or bucket prefix to which the
command applies the specified :mc-cmd:`~mc policy set-json POLICY`.
Specify the :ref:`alias <alias>` of the MinIO or other
S3-compatible service *and* the full path to the bucket or bucket
prefix. For example:
.. code-block:: shell
mc set-json public play/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Set Anonymous Policy for Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc policy set-json` to set the anonymous policy for a
bucket:
.. code-block:: shell
:class: copyable
mc policy set-json POLICY ALIAS/PATH
- Replace :mc-cmd:`POLICY <mc policy set-json POLICY>` with a supported
:mc-cmd:`POLICY <mc policy set-json POLICY>`.
- Replace :mc-cmd:`ALIAS <mc policy set-json ALIAS>` with the
:mc-cmd:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc policy set-json ALIAS>` with the destination bucket.
Remove Anonymous Policy for Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc policy set` to clear the anonymous policy for a
bucket:
.. code-block:: shell
:class: copyable
mc policy set none ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc policy set ALIAS>` with the
:mc-cmd:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc policy set ALIAS>` with the destination bucket.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,140 @@
.. _minio-mc-policy-set:
=================
``mc policy set``
=================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc policy
.. mc:: mc policy set
Syntax
------
.. start-mc-policy-set-desc
The :mc:`mc policy set` command sets anonymous (i.e. unauthenticated or public)
access :ref:`policies <minio-policy>` for a bucket.
.. end-mc-policy-set-desc
Buckets with anonymous policies allow clients to access the bucket contents
and perform actions consistent with the specified policy without
:ref:`authentication <minio-authentication-and-identity-management>`.
To set anonymous bucket policies using an IAM
:s3-docs:`JSON policy <using-iam-policies>`, use the
:mc-cmd:`mc policy set-json` command.
.. tab-set::
.. tab-item:: EXAMPLE
The following command sets anonymous access policies for several
buckets on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc policy set upload myminio/uploads
mc policy set download myminio/downloads
mc policy set public myminio/public
Applications can perform the following operations without authentication:
- ``PUT`` objects to ``myminio/uploads`` and ``myminio/public``.
- ``GET`` objects from ``myminio/downloads`` and ``myminio/public``.
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] policy set PERMISSION ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: PERMISSION
*Required* Name of the policy to assign to the specified ``ALIAS``.
Specify one of the following values:
- ``none`` - Disable anonymous access to the ``ALIAS``.
- ``download`` - Enable download-only access to the ``ALIAS``.
- ``upload`` - Enable upload-only access to the ``ALIAS``.
- ``public`` - Enable download and upload access to the ``ALIAS``.
.. mc-cmd:: ALIAS
*Required* The full path to the bucket or bucket prefix to which the
command applies the specified :mc-cmd:`~mc policy set PERMISSION`.
Specify the :ref:`alias <alias>` of the MinIO or other
S3-compatible service *and* the full path to the bucket or bucket
prefix. For example:
.. code-block:: shell
mc set public play/mybucket
Specify a bucket prefix to set the policy on only that prefix. For example,
this command sets distinct anonymous bucket policies on the
``mybucket/downloads`` and ``mybucket/uploads`` prefixes:
.. code-block:: shell
mc set download play/mybucket/downloads
mc set upload play/mybucket/uploads
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Set Anonymous Policy for Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc policy set` to set the anonymous policy for a
bucket:
.. code-block:: shell
:class: copyable
mc policy set POLICY ALIAS/PATH
- Replace :mc-cmd:`POLICY <mc policy set PERMISSION>` with a supported
:mc-cmd:`permission <mc policy set PERMISSION>`.
- Replace :mc-cmd:`ALIAS <mc policy set ALIAS>` with the
:mc-cmd:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc policy set ALIAS>` with the destination bucket.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,147 @@
=========
``mc rb``
=========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc rb
Syntax
------
.. start-mc-rb-desc
The :mc:`mc rb` command removes one or more buckets on MinIO *or*
another S3-compatible service.
To remove only the contents of a bucket, use :mc:`mc rm` instead.
.. end-mc-rb-desc
.. important::
:mc:`mc rb` *permanently deletes bucket(s)* on the target deployment,
including any and all :ref:`object versions <minio-bucket-versioning>`
and bucket configurations such as
:ref:`lifecycle management <minio-lifecycle-management>` or
:ref:`replication <minio-bucket-replication-serverside>`.
You can also use :mc:`mc rb` against the local filesystem to produce
similar results to the ``rm --rf`` commandline tool.
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes the ``mydata`` bucket on the
``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc rb --force myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] rb \
--force \
[--dangerous] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO or other S3-compatible
service and the full path to the bucket to remove. For example:
.. code-block:: none
mc rb --force myminio/mydata
Omit the bucket path to perform a site-wide removal of buckets on the MinIO
deployment. This operation *requires* specifying
:mc-cmd-option:`~mc rb dangerous` to explicitly acknowledge the permanent
removal of *all* data on the deployment. For example:
.. code-block:: none
mc rb --force --dangerous myminio
For removing a directory and its contents on a local filesystem, specify
the full path to that directory. The
:mc-cmd-option:`~mc rb force` flag is ignored if specified. For example:
.. code-block:: none
mc rb ~/data/myolddata
.. mc-cmd:: force
:option:
*Required* Safety flag to confirm removal of the bucket contents.
.. mc-cmd:: dangerous
:option:
*Optional* Directs :mc:`mc rb` to perform a site-wide removal of all
buckets on each specified :mc-cmd:`~mc rb ALIAS` (e.g. ``myminio/``).
If any ``ALIAS`` specifies a filesystem directory, this option
results in the removal of all subdirectories and files at that directory
path similar to ``rm --rf``.
.. warning::
Running :mc-cmd-option:`mc rb dangerous` is irreversible. Exercise all
possible due diligence in ensuring the command applies to only the
desired ``ALIAS`` targets prior to execution.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Example
-------
Remove a Bucket
~~~~~~~~~~~~~~~
.. code-block:: shell
:class: copyable
mc rb --force ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc rb ALIAS>` with the :mc-cmd:`alias <mc alias>` of
a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc rb ALIAS>` with the path to the bucket to remove.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,421 @@
.. _minio-mc-replicate-add:
====================
``mc replicate add``
====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc replicate
.. mc:: mc replicate add
Syntax
------
.. start-mc-replicate-add-desc
The :mc:`mc replicate add` command creates a new :ref:`server-side replication
<minio-bucket-replication-serverside>` rule for a bucket on a MinIO deployment.
.. end-mc-replicate-add-desc
The MinIO deployment automatically begins synchronizing new objects to the
remote MinIO deployment after creating the rule. You can optionally configure
synchronization of existing objects, delete operations, and fully-deleted
objects.
This command *requires* first configuring the remote bucket target using the
:mc-cmd:`mc admin bucket remote add` command. You must specify the resulting
remote ARN as part of running :mc-cmd:`mc replicate add`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command adds a new replication rule for the ``mydata``
bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc replicate add \
--remote-bucket "arn:minio:replication:aefc8b3a-1f6c-4d7a-86dc-1b0bdffa9100:mydata" \
--replicate "delete,delete-marker,existing-objects" \
myminio/mydata
The replication rule synchronizes versioned delete operations, delete
markers, and existing objects to the remote MinIO deployment.
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] replicate add \
--remote-bucket "string" \
[--disable] \
[--id "string"] \
[--replicate "string"] \
[--storage-class "string"] \
[--tags "string"] \
[--priority int] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* the :ref:`alias <alias>` of the MinIO deployment and full path to
the bucket or bucket prefix on which to create the replication rule. For
example:
.. code-block:: none
mc replicate add --remote-bucket "arn:minio:replica::UUID" play/mybucket
.. mc-cmd:: remote-bucket
:option:
*Required* Specify the ARN for the destination deployment and bucket. You
can retrieve the ARN using :mc-cmd:`mc admin bucket remote`:
- Use the :mc-cmd:`mc admin bucket remote ls` to retrieve a list of
ARNs for the bucket on the destination deployment.
- Use the :mc-cmd:`mc admin bucket remote add` to create a replication ARN
for the bucket on the destination deployment.
.. mc-cmd:: disable
:option:
*Optional* Creates the replication rule in the "disabled" state. MinIO does
not begin replicating objects using the rule until it is enabled using
:mc-cmd:`mc replicate edit`.
Objects created while replication is disabled are not
immediately eligible for replication after enabling the rule.
You must explicitly enable replication of existing
objects by including ``"existing-objects"`` to the list of
replication features specified to
:mc-cmd-option:`mc replicate edit replicate`. See
:ref:`minio-replication-behavior-existing-objects` for more
information.
.. mc-cmd:: id
:option:
*Optional* Specify a unique ID for the replication rule. MinIO automatically
generates an ID if one is not specified.
.. mc-cmd:: replicate
:option:
*Optional* Specify a comma-separated list of the following values to enable
extended replication features.
- ``delete`` - Directs MinIO to replicate DELETE operations to the
destination bucket.
- ``delete-marker`` - Directs MinIO to replicate delete markers to the
destination bucket.
- ``existing-objects`` - Directs MinIO to replicate objects created
before replication was enabled *or* while replication was suspended.
.. mc-cmd:: storage-class
:option:
*Optional*
Specify the MinIO :ref:`storage class <minio-ec-storage-class>` to
apply to replicated objects.
.. mc-cmd:: tags
:option:
*Optional* Specify one or more ampersand ``&`` separated key-value pair tags
which MinIO uses for filtering objects to replicate. For example:
.. code-block:: shell
mc replicate add --tags "TAG1=VALUE&TAG2=VALUE&TAG3=VALUE" ALIAS
MinIO applies the replication rule to any object whose tag set
contains the specified replication tags.
.. mc-cmd:: priority
:option:
*Optional* Specify the integer priority of the replication rule. The value
*must* be unique among all other rules on the source bucket. Higher values
imply a *higher* priority than all other rules.
The default value is ``0``.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Configure Bucket Replication
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following :mc-cmd:`mc replicate add` command creates a replication
configuration that synchronizes all new objects, existing objects, delete
operations, and delete markers to the remote target:
.. code-block:: shell
:class: copyable
mc replicate add myminio/mybucket \
--remote-bucket "arn:minio:replica::UUID" \
--replicate "delete,delete-marker,existing-objects"
- Replace ``myminio/mybucket`` with the :mc-cmd:`~mc replicate add ALIAS` and
full bucket path for which to create the replication configuration.
- Replace the :mc-cmd-option:`~mc replicate add remote-bucket` value with the
ARN of the remote target. Use :mc-cmd:`mc admin bucket remote ls` to list
all configured remote replication targets.
- The :mc-cmd-option:`~mc replicate add replicate` flag directs MinIO to
replicate all delete operations, delete markers, and existing objects to the
remote. See :ref:`minio-replication-behavior-delete` and
:ref:`minio-replication-behavior-existing-objects` for more information on
replication behavior.
Configure Bucket Replication for Historical Data Record
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following :mc-cmd:`mc replicate add` command creates a new bucket
replication configuration that synchronizes all new and existing objects
to the remote target:
.. code-block:: shell
:class: copyable
mc replicate add myminio/mybucket \
--remote-bucket "arn:minio:replica::UUID" \
--replicate "existing-objects"
- Replace ``myminio/mybucket`` with the :mc-cmd:`~mc replicate add ALIAS` and
full bucket path for which to create the replication configuration.
- Replace the :mc-cmd-option:`~mc replicate add remote-bucket` value with the
ARN of the remote target. Use :mc-cmd:`mc admin bucket remote ls` to list
all configured remote replication targets.
- The :mc-cmd-option:`~mc replicate add replicate` flag directs MinIO to
replicate all existing objects to the remote. See
:ref:`minio-replication-behavior-existing-objects` for more information on
replication behavior.
The resulting remote copy represents a historical record of objects on the
remote, where delete operations on the source have no effect on the remote
copy.
Behavior
--------
Server-Side Replication Requires MinIO Source and Destination
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO server-side replication only works between MinIO deployments. Both the
source and destination deployments *must* run MinIO.
To configure replication between arbitrary S3-compatible services,
use :mc-cmd:`mc mirror`.
Enable Versioning on Source and Destination Buckets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO relies on the immutability protections provided by versioning to
synchronize objects between the source and replication target.
Use the :mc-cmd:`mc version suspend` command to enable versioning on
*both* the source and destination bucket before starting this procedure:
.. code-block:: shell
:class: copyable
mc version ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc version ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc version ALIAS>` with the bucket on which
to enable versioning.
Required Permissions
~~~~~~~~~~~~~~~~~~~~
MinIO strongly recommends creating users specifically for supporting
bucket replication operations. See
:mc:`mc admin user` and :mc:`mc admin policy` for more complete
documentation on adding users and policies to a MinIO deployment.
.. tab-set::
.. tab-item:: Replication Admin
The following policy provides permissions for configuring and enabling
replication on a deployment.
.. literalinclude:: /extra/examples/ReplicationAdminPolicy.json
:class: copyable
:language: json
- The ``"EnableRemoteBucketConfiguration"`` statement grants permission
for creating a remote target for supporting replication.
- The ``"EnableReplicationRuleConfiguration"`` statement grants permission
for creating replication rules on a bucket. The ``"arn:aws:s3:::*``
resource applies the replication permissions to *any* bucket on the
source deployment. You can restrict the user policy to specific buckets
as-needed.
Use the :mc-cmd:`mc admin policy add` to add this policy to each
deployment acting as a replication source. Use :mc-cmd:`mc admin user add`
to create a user on the deployment and :mc-cmd:`mc admin policy set`
to associate the policy to that new user.
.. tab-item:: Replication Remote User
The following policy provides permissions for enabling synchronization of
replicated data *into* the deployment.
.. literalinclude:: /extra/examples/ReplicationRemoteUserPolicy.json
:class: copyable
:language: json
- The ``"EnableReplicationOnBucket"`` statement grants permission for
a remote target to retrieve bucket-level configuration for supporting
replication operations on *all* buckets in the MinIO deployment. To
restrict the policy to specific buckets, specify those buckets as an
element in the ``Resource`` array similar to
``"arn:aws:s3:::bucketName"``.
- The ``"EnableReplicatingDataIntoBucket"`` statement grants permission
for a remote target to synchronize data into *any* bucket in the MinIO
deployment. To restrict the policy to specific buckets, specify those
buckets as an element in the ``Resource`` array similar to
``"arn:aws:s3:::bucketName/*"``.
Use the :mc-cmd:`mc admin policy add` to add this policy to each
deployment acting as a replication target. Use :mc-cmd:`mc admin user add`
to create a user on the deployment and :mc-cmd:`mc admin policy set`
to associate the policy to that new user.
Replication of Existing Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting with :mc:`mc`
:minio-git:`RELEASE.2021-06-13T17-48-22Z <mc/releases/tag/RELEASE.2021-06-13T17-48-22Z>`
and :mc:`minio`
:minio-git:`RELEASE.2021-06-07T21-40-51Z <minio/releases/tag/RELEASE.2021-06-07T21-40-51Z>`,
MinIO supports automatically replicating existing objects in a bucket. MinIO
existing object replication implements functionality similar to
`AWS Replicating existing objects between S3 buckets
<https://aws.amazon.com/blogs/storage/replicating-existing-objects-between-s3-buckets/>`__
without the overhead of contacting technical support.
- To enable replication of existing objects when creating a new replication
rule, include ``"existing-objects"`` to the list of replication features
specified to :mc-cmd-option:`mc replicate add replicate`.
- To enable replication of existing objects for an existing replication rule,
add ``"existing-objects"`` to the list of existing replication features using
:mc-cmd-option:`mc replicate add replicate`. You must specify *all*
desired replication features when editing the replication rule.
See :ref:`minio-replication-behavior-existing-objects` for more complete
documentation on this behavior.
Synchronization of Metadata Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO supports :ref:`two-way active-active
<minio-bucket-replication-serverside-twoway>` replication configurations, where
MinIO synchronizes new and modified objects between a bucket on two MinIO
deployments. Starting with :mc:`mc`
:minio-git:`RELEASE.2021-05-18T03-39-44Z <mc/releases/tag/RELEASE.2021-05-18T03-39-44Z>`,
MinIO by default synchronizes metadata-only changes to a replicated object back
to the "source" deployment. Prior to the this update, MinIO did not support
synchronizing metadata-only changes to a replicated object.
With metadata synchronization enabled, MinIO resets the object
:ref:`replication status <minio-replication-process>` to indicate
replication eligibility. Specifically, when an application performs a
metadata-only update to an object with the ``REPLICA`` status, MinIO marks the
object as ``PENDING`` and eligible for replication.
To disable metadata synchronization, use the
:mc-cmd-option:`mc replicate edit replicate` command and omit
``replica-metadata-sync`` from the replication feature list.
Replication of Delete Operations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO supports replicating delete operations onto the target bucket.
Specifically, MinIO can replicate both
:s3-docs:`Delete Markers <versioning-workflows.html>` *and* the deletion
of specific versioned objects:
- For delete operations on an object, MinIO replication also creates the delete
marker on the target bucket.
- For delete operations on versions of an object,
MinIO replication also deletes those versions on the target bucket.
MinIO does *not* replicate objects deleted due to
:ref:`lifecycle management expiration rules
<minio-lifecycle-management-expiration>`. MinIO only replicates explicit
client-driven delete operations.
MinIO requires explicitly enabling replication of delete operations using the
:mc-cmd-option:`mc replicate add replicate` flag. This procedure includes the
required flags for enabling replication of delete operations and delete markers.
See :ref:`minio-replication-behavior-delete` for more complete documentation
on this behavior.
Replication of Encrypted Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO supports replicating objects encrypted with automatic
Server-Side Encryption (SSE-S3). Both the source and destination buckets
*must* have automatic SSE-S3 enabled for MinIO to replicate an encrypted object.
As part of the replication process, MinIO *decrypts* the object on the source
bucket and transmits the unencrypted object. The destination MinIO deployment then
re-encrypts the object using the destination bucket SSE-S3 configuration. MinIO
*strongly recommends* :ref:`enabling TLS <minio-TLS>` on both source and
destination deployments to ensure the safety of objects during transmission.
MinIO does *not* support replicating client-side encrypted objects
(SSE-C).
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,318 @@
.. _minio-mc-replicate-edit:
=====================
``mc replicate edit``
=====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc replicate edit
Syntax
------
.. start-mc-replicate-edit-desc
The :mc:`mc replicate edit` command modifies an existing
:ref:`bucket replication rule <minio-bucket-replication-serverside>`.
.. end-mc-replicate-edit-desc
.. code-block:: shell
mc [GLOBALFLAGS] replicate edit FLAGS [FLAGS] ARGUMENTS [ARGUMENTS]
.. tab-set::
.. tab-item:: EXAMPLE
The following command modifies an existing replication rule for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc replicate edit --id "c76um9h4b0t1ijr36mug" \
--replicate "delete,delete-marker,existing-objects" \
myminio/mydata
The new replication configuration synchronizes all versioned delete
operations, delete marker creation, and existing objects to the remote
MinIO deployment.
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] replicate edit \
--id "string" \
[--remote-bucket "string"] \
[--disable] \
[--id "string"] \
[--replicate "string"] \
[--state "string"] \
[--storage-class "string"] \
[--tags "string"] \
[--priority int] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* the :ref:`alias <alias>` of the MinIO deployment and full path to
the bucket or bucket prefix on which to modify the replication rule. For
example:
.. code-block:: none
mc replicate edit --id "c75nrap4b0talo3ipthg" [FLAGS]
.. mc-cmd:: id
:option:
*Required* Specify the unique ID for a configured replication rule.
Use the :mc-cmd:`mc replicate ls` command to list the replication rules
for a bucket.
.. mc-cmd:: priority
:option:
*Optional* Specify the integer priority of the replication rule. The value
*must* be unique among all other rules on the source bucket. Higher values
imply a *higher* priority than all other rules.
.. mc-cmd:: remote-bucket
:option:
*Optional* Specify the ARN for the destination deployment and bucket. You
can retrieve the ARN using :mc-cmd:`mc admin bucket remote`:
- Use the :mc-cmd:`mc admin bucket remote ls` to retrieve a list of
ARNs for the bucket on the destination deployment.
- Use the :mc-cmd:`mc admin bucket remote add` to create a replication ARN
for the bucket on the destination deployment.
.. mc-cmd:: replicate
:option:
*Optional* Specify a comma-separated list of the following values to enable
extended replication features:
- ``delete`` - Directs MinIO to replicate DELETE operations to the
destination bucket.
- ``delete-marker`` - Directs MinIO to replicate delete markers to the
destination bucket.
- ``replica-metadata-sync`` - Directs MinIO to synchronize metadata-only
changes on a replicated object back to the source. This feature only
effects :ref:`two-way active-active
<minio-bucket-replication-serverside-twoway>` replication
configurations.
Omitting this value directs MinIO to stop replicating metadata-only
changes back to the source.
- ``existing-objects`` - Directs MinIO to replicate objects created
prior to configuring or enabling replication. MinIO by default does
*not* synchronize existing objects to the remote target.
See :ref:`minio-replication-behavior-existing-objects` for more
information.
.. mc-cmd:: state
:option:
*Optional* Enables or disables the replication rule. Specify one of the
following values:
- ``"enable"`` - Enables the replication rule.
- ``"disable"`` - Disables the replication rule.
Objects created while replication is disabled are not immediately eligible
for replication after enabling the rule. You must explicitly enable
replication of existing objects by including ``"existing-objects"`` to the
list of replication features specified to
:mc-cmd-option:`mc replicate edit replicate`. See
:ref:`minio-replication-behavior-existing-objects` for more information.
.. mc-cmd:: storage-class
:option:
*Optional* Specify the MinIO :ref:`storage class <minio-ec-storage-class>`
to apply to replicated objects.
.. mc-cmd:: tags
:option:
*Optional* Specify one or more ampersand ``&`` separated key-value pair tags
which MinIO uses for filtering objects to replicate. For example:
.. code-block:: shell
mc replicate edit --id "ID" --tags "TAG1=VALUE&TAG2=VALUE&TAG3=VALUE"
MinIO applies the replication rule to any object whose tag set
contains the specified replication tags.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Modify an Existing Replication Rule
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc replicate edit` to modify an existing replication rule.
.. code-block:: shell
:class: copyable
mc replicate edit ALIAS/PATH \
--id ID \
[--FLAGS]
- Replace :mc-cmd:`ALIAS <mc replicate edit ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc replicate edit ALIAS>` with the path to the
bucket or bucket prefix on which the rule exists.
- Replace :mc-cmd:`ID <mc replicate edit id>` with the unique identifier for the
rule to modify. Use :mc-cmd:`mc replicate ls` to retrieve the list of
replication rules on the bucket and their corresponding identifiers.
.. note::
Modifying a replication configuration rule does not effect already replicated
objects. For example, modifying the :mc-cmd-option:`~mc replicate edit tags`
filter does not result in the removal of replicated objects which do not
meet the filter.
Disable or Enable an Existing Replication Rule
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc replicate edit` with the
:mc-cmd-option:`~mc replicate edit state` flag to disable or enable a
replication rule.
.. code-block:: shell
:class: copyable
mc replicate edit ALIAS/PATH \
--id ID \
--state "disabled"|"enabled"
- Replace :mc-cmd:`ALIAS <mc replicate edit ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc replicate edit ALIAS>` with the path to the
bucket or bucket prefix on which the rule exists.
- Replace :mc-cmd:`ID <mc replicate edit id>` with the unique identifier for the
rule to modify. Use :mc-cmd:`mc replicate ls` to retrieve the list of
replication rules on the bucket and their corresponding identifiers.
- Specify either ``"disabled"`` or ``"enabled"`` to the
:mc-cmd:`~mc replicate edit state` flag to disable or enable the replication
rule.
.. note::
MinIO requires enabling :ref:`existing object replication
<minio-replication-behavior-existing-objects>` to synchronize objects
written or removed after disabling a replication rule.
For rules *without* existing object replication, MinIO synchronizes only
those write or delete operations issued while the replication rule is
*enabled*.
Behavior
--------
Required Permissions
~~~~~~~~~~~~~~~~~~~~
MinIO strongly recommends creating users specifically for supporting
bucket replication operations. See
:mc:`mc admin user` and :mc:`mc admin policy` for more complete
documentation on adding users and policies to a MinIO deployment.
.. tab-set::
.. tab-item:: Replication Admin
The following policy provides permissions for configuring and enabling
replication on a deployment.
.. literalinclude:: /extra/examples/ReplicationAdminPolicy.json
:class: copyable
:language: json
- The ``"EnableRemoteBucketConfiguration"`` statement grants permission
for creating a remote target for supporting replication.
- The ``"EnableReplicationRuleConfiguration"`` statement grants permission
for creating replication rules on a bucket. The ``"arn:aws:s3:::*``
resource applies the replication permissions to *any* bucket on the
source deployment. You can restrict the user policy to specific buckets
as-needed.
Use the :mc-cmd:`mc admin policy add` to add this policy to each
deployment acting as a replication source. Use :mc-cmd:`mc admin user add`
to create a user on the deployment and :mc-cmd:`mc admin policy set`
to associate the policy to that new user.
.. tab-item:: Replication Remote User
The following policy provides permissions for enabling synchronization of
replicated data *into* the deployment.
.. literalinclude:: /extra/examples/ReplicationRemoteUserPolicy.json
:class: copyable
:language: json
- The ``"EnableReplicationOnBucket"`` statement grants permission for
a remote target to retrieve bucket-level configuration for supporting
replication operations on *all* buckets in the MinIO deployment. To
restrict the policy to specific buckets, specify those buckets as an
element in the ``Resource`` array similar to
``"arn:aws:s3:::bucketName"``.
- The ``"EnableReplicatingDataIntoBucket"`` statement grants permission
for a remote target to synchronize data into *any* bucket in the MinIO
deployment. To restrict the policy to specific buckets, specify those
buckets as an element in the ``Resource`` array similar to
``"arn:aws:s3:::bucketName/*"``.
Use the :mc-cmd:`mc admin policy add` to add this policy to each
deployment acting as a replication target. Use :mc-cmd:`mc admin user add`
to create a user on the deployment and :mc-cmd:`mc admin policy set`
to associate the policy to that new user.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,98 @@
.. _minio-mc-replicate-export:
=======================
``mc replicate export``
=======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc replicate export
Syntax
------
.. start-mc-replicate-export-desc
The :mc:`mc replicate export` command exports the JSON-formatted
:ref:`replication rules <minio-bucket-replication-serverside>` for a
MinIO bucket to ``STDOUT``.
.. end-mc-replicate-export-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command exports the replication configuration for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc replicate export myminio/mydata > mydata-replication.json
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] export ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* the :ref:`alias <alias>` of the MinIO deployment and full path to
the bucket or bucket prefix for which to export the replication rules. For
example:
.. code-block:: none
mc replicate export myminio/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Export Existing Replication Rules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc replicate export` to export bucket replication rules:
.. code-block:: shell
:class: copyable
mc replicate export ALIAS/PATH > bucket-replication-rules.json
- Replace :mc-cmd:`ALIAS <mc replicate export ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc replicate export ALIAS>` with the path to the
bucket or bucket prefix.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,104 @@
.. _minio-mc-replicate-import:
=======================
``mc replicate import``
=======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc replicate import
Syntax
------
.. start-mc-replicate-import-desc
The :mc:`mc replicate import` command imports JSON-formatted
:ref:`replication rules <minio-bucket-replication-serverside>` for a
MinIO bucket from ``STDIN``.
.. end-mc-replicate-import-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command imports the replication configuration for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc replicate import myminio/mydata < mydata-replication.json
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] import ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* the :ref:`alias <alias>` of the MinIO deployment and full path to
the bucket or bucket prefix for which to import the replication rules. For
example:
.. code-block:: none
mc replicate import myminio/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Import Existing Replication Rules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc replicate import` to import bucket replication rules:
.. code-block:: shell
:class: copyable
mc replicate import ALIAS/PATH < bucket-replication-rules.json
- Replace :mc-cmd:`ALIAS <mc replicate import ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc replicate import ALIAS>` with the path to the
bucket or bucket prefix.
Behavior
--------
Importing Configuration Overrides Existing Rules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:mc-cmd:`mc replicate import` replaces the current bucket replication
rules with those defined in the imported JSON configuration.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,113 @@
.. _minio-mc-replicate-ls:
===================
``mc replicate ls``
===================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc replicate ls
Syntax
------
.. start-mc-replicate-ls-desc
The :mc:`mc replicate ls` command lists all
:ref:`replication rules <minio-bucket-replication-serverside>` on a
MinIO bucket.
.. end-mc-replicate-ls-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command lists all enabled replication rules for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc replicate ls --status "enabled" myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] replicate ls \
[--status "string"] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* the :ref:`alias <alias>` of the MinIO deployment and full path to
the bucket or bucket prefix for which to list the replication rules. For
example:
.. code-block:: none
mc replicate ls myminio/mybucket
.. mc-cmd:: status
:option:
*Optional* Filter replication rules on the bucket based on their status.
Specify one of the following values:
- ``enabled`` - Show only enabled replication rules.
- ``disabled`` - Show only disabled replication rules.
If omitted, :mc-cmd:`mc replicate ls` defaults to showing all replication
rules.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List Existing Replication Rules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc replicate ls` to list bucket replication rules:
.. code-block:: shell
:class: copyable
mc replicate ls ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc replicate ls ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc replicate ls ALIAS>` with the path to the
bucket or bucket prefix.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,136 @@
.. _minio-mc-replicate-resync:
=======================
``mc replicate resync``
=======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc replicate reset
.. mc:: mc replicate resync
Syntax
------
.. start-mc-replicate-resync-desc
The :mc:`mc replicate resync` command resynchronizes all objects in the
specified MinIO bucket to a remote :ref:`replication
<minio-bucket-replication-serverside>` target.
.. end-mc-replicate-resync-desc
This command *requires* first configuring the remote bucket target using the
:mc-cmd:`mc admin bucket remote add` command. You must specify the resulting
remote ARN as part of running :mc-cmd:`mc replicate resync`.
This command supports rebuilding a MinIO deployment using an active-active
replication remote as the "backup" source. See the following tutorials
for more information on active-active replication:
- :ref:`minio-bucket-replication-serverside-twoway`
- :ref:`minio-bucket-replication-serverside-multi`
.. tab-set::
.. tab-item:: EXAMPLE
The following command resynchronizes the content of the
``mydata`` bucket on the ``myminio`` MinIO deployment to the remote
MinIO deployment associated to the specified ``--remote-bucket``:
.. code-block:: shell
:class: copyable
mc replicate resync \
--remote-bucket "arn:minio:replication::d3c086c7-1d64-40c2-954b-fe8222907033:mydata" \
myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] replicate resync \
--remote-bucket "string" \
[--older-than "string"] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* the :ref:`alias <alias>` of the MinIO deployment and full path to
the bucket or bucket prefix which MinIO uses as the replication source. For
example:
.. code-block:: none
mc replicate resync myminio/mybucket
.. mc-cmd:: remote-bucket
:option:
*Required* Specify the ARN for the destination deployment and bucket. You
can retrieve the ARN using :mc-cmd:`mc admin bucket remote`:
- Use the :mc-cmd:`mc admin bucket remote ls` to retrieve a list of
ARNs for the bucket on the destination deployment.
- Use the :mc-cmd:`mc admin bucket remote add` to create a replication ARN
for the bucket on the destination deployment.
.. mc-cmd:: older-than
*Optional* Specify a duration in days where MinIO only resynchronizes
objects older than the specified duration.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Resynchronize Remote Replication Target from Source Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following :mc-cmd:`mc replicate resync` command resynchronizes all objects
on the specified source bucket to the remote target regardless of their
replication status:
.. code-block:: shell
:class: copyable
mc replicate resync --remote-bucket "arn:minio:replication::UUID:mybucket" myminio/mybucket
- Replace ``myminio/mybucket`` with the :mc-cmd:`~mc replicate add ALIAS` and
full bucket path for which to create the replication configuration.
- Replace the :mc-cmd-option:`~mc replicate add remote-bucket` value with the
ARN of the remote target. Use :mc-cmd:`mc admin bucket remote ls` to list
all configured remote replication targets.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,158 @@
.. _minio-mc-replicate-rm:
===================
``mc replicate rm``
===================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc replicate rm
Syntax
------
.. start-mc-replicate-rm-desc
The :mc:`mc replicate rm` command removes a
:ref:`replication rule <minio-bucket-replication-serverside>` from a
MinIO bucket.
.. end-mc-replicate-rm-desc
.. code-block:: shell
mc [GLOBALFLAGS] replicate rm FLAGS [FLAGS] ALIAS
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes the replication rule with specified
id from the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc replicate rm --id "c76um9h4b0t1ijr36mug" myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] replicate rm \
--id "string" \
[--all --force] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* the :ref:`alias <alias>` of the MinIO deployment and full path to
the bucket or bucket prefix from which to remove the replication rule. For
example:
.. code-block:: none
mc replicate rm --id "ID" myminio/mybucket
.. mc-cmd:: id
:option:
*Required* Specify the unique ID for a configured replication rule.
You can omit this option if specifying :mc-cmd-option:`~mc replicate rm all`
.. mc-cmd:: all
:option:
*Optional* Removes all replication rules on the specified bucket. Requires
specifying the :mc-cmd-option:`~mc replicate rm force` flag.
.. mc-cmd:: force
:option:
*Optional* Required if specifying :mc-cmd-option:`~mc replicate rm all` .
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Remove a Replication Rule from a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc replicate rm` to remote a bucket replication rule:
.. code-block:: shell
:class: copyable
mc replicate rm --id "ID" ALIAS/PATH
- Replace :mc-cmd-option:`ID <mc replicate rm id>` with the unique ID of the
replication rule to remove. Use :mc-cmd:`mc replicate ls` to list all
replication rules for the bucket.
- Replace :mc-cmd:`ALIAS <mc replicate rm ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc replicate rm ALIAS>` with the path to the
bucket or bucket prefix.
Remove All Replication Rules from a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc replicate rm` to list bucket replication rules:
.. code-block:: shell
:class: copyable
mc replicate rm --all --force ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc replicate rm ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc replicate rm ALIAS>` with the path to the
bucket or bucket prefix.
Behavior
--------
Removing Replication Rules Does Not Affect Replicated Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Removing one or all replication rule for a bucket does *not*
remove any objects already replicated under those rule(s).
Use The command or :mc-cmd:`mc rb` commands to remove replicated
objects on the remote target. You can identify replicated objects using
the ``X-Amz-Replication-Status`` metadata field where the value is
``REPLICA``. Buckets which contain objects from multiple replication sources
may require additional care and filtering to determine the source prior
to removal.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,89 @@
.. _minio-mc-replicate-status:
=======================
``mc replicate status``
=======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc replicate status
Syntax
------
.. start-mc-replicate-status-desc
The :mc:`mc replicate status` command displays the
:ref:`replication status <minio-bucket-replication-serverside>` of a
MinIO bucket.
.. end-mc-replicate-status-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command displays the current replication status of the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc replicate status myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] replicate status ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* the :ref:`alias <alias>` of the MinIO deployment and full path to
the bucket or bucket prefix for which to display the replication status. For
example:
.. code-block:: none
mc replicate status myminio/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Display Replication Status
~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc replicate status` to show bucket replication status:
.. code-block:: shell
:class: copyable
mc replicate status ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc replicate status ALIAS>` with the
:mc:`alias <mc alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc replicate status ALIAS>` with the path to the
bucket or bucket prefix.

View File

@ -0,0 +1,199 @@
======================
``mc retention clear``
======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc retention clear
.. |command| replace:: :mc-cmd:`mc retention clear`
.. |rewind| replace:: :mc-cmd-option:`~mc retention clear rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc retention clear version-id`
.. |versions| replace:: :mc-cmd-option:`~mc retention clear versions`
.. |alias| replace:: :mc-cmd-option:`~mc retention clear ALIAS`
Syntax
------
.. start-mc-retention-desc
The :mc:`mc retention clear` command removes the
:ref:`Write-Once Read-Many (WORM) locking <minio-object-locking>` settings for
an object or object(s) in a bucket. You can also remove the default object lock
settings for a bucket.
.. end-mc-retention-desc
To change the retention status of an object under
:ref:`legal hold <minio-object-locking-legalhold>`, use
:mc:`mc legalhold clear`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes the default object lock configuration for
the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc retention clear --default myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] retention clear \
[--default] \
[--recursive] \
[--rewind "string"] \
[--version-id "string"]* \
[--versions] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
:mc-cmd-option:`mc retention clear version-id` is mutually exclusive with
multiple other parameters. See the reference documentation for more
information.
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The full path to the object or objects for which to clear
the object lock configuration. Specify the :mc-cmd:`alias <mc alias>` of a
configured S3-compatible service as the prefix to the ``ALIAS`` bucket
path. For example:
.. code-block:: shell
mc retention clear play/mybucket/object.txt
- If the ``ALIAS`` specifies a bucket or bucket prefix, include
:mc-cmd-option:`~mc retention clear recursive` to clear the object lock
settings to the bucket contents.
- If the ``ALIAS`` bucket has versioning enabled,
:mc-cmd:`mc retention clear` by default applies to only the latest
object version. Use :mc-cmd-option:`~mc retention clear version-id` or
:mc-cmd-option:`~mc retention clear versions` to clear the object lock
settings for a specific version or for all versions of the object.
.. mc-cmd:: default
:option:
*Optional* Clears the default object lock settings for the bucket specified
to :mc-cmd:`~mc retention clear ALIAS`.
If specifying :mc-cmd-option:`~mc retention clear default`,
:mc-cmd:`mc retention clear` ignores all other flags.
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively clears the object lock settings for all objects in the
specified :mc-cmd:`~mc retention clear ALIAS` path.
Mutually exclusive with :mc-cmd-option:`~mc retention clear version-id`.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Mutually exclusive with any of the following flags:
- :mc-cmd-option:`~mc retention clear versions`
- :mc-cmd-option:`~mc retention clear rewind`
- :mc-cmd-option:`~mc retention clear recursive`
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc retention clear versions` and
:mc-cmd-option:`~mc retention clear rewind` together to remove the
retention settings from all object versions that existed at a
specific point-in-time.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Clear Object Lock Settings for an Object or Object(s)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Specific Object
.. code-block:: shell
:class: copyable
mc retention clear ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc retention clear ALIAS>` with the
:mc:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc retention clear ALIAS>` with the path to the
object.
.. tab-item:: Multiple Objects
Use :mc-cmd:`mc retention clear` with
:mc-cmd-option:`~mc retention clear recursive` to clear the retention
settings from all objects in a bucket:
.. code-block:: shell
:class: copyable
mc retention clear --recursive ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc retention clear ALIAS>` with the
:mc:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc retention clear ALIAS>` with the path to the
bucket.
.. include:: /includes/facts-locking.rst
:start-after: start-command-requires-locking-desc
:end-before: end-command-requires-locking-desc
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibilit

View File

@ -0,0 +1,226 @@
=====================
``mc retention info``
=====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc retention info
.. |command| replace:: :mc-cmd:`mc retention info`
.. |rewind| replace:: :mc-cmd-option:`~mc retention info rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc retention info version-id`
.. |alias| replace:: :mc-cmd-option:`~mc retention info ALIAS`
.. |versions| replace:: :mc-cmd-option:`~mc retention info versions`
Syntax
------
.. start-mc-retention-desc
The :mc:`mc retention info` command configures the :ref:`Write-Once Read-Many (WORM)
locking <minio-object-locking>` settings for an object or object(s) in a bucket.
You can also set the default object lock settings for a bucket, where all
objects without explicit object lock settings inherit the bucket default.
.. end-mc-retention-desc
To lock an object under :ref:`legal hold <minio-object-locking-legalhold>`,
use :mc:`mc legalhold`.
:mc:`mc retention info` *requires* that the specified bucket has object locking
enabled. You can **only** enable object locking at bucket creation. See
:mc-cmd-option:`mc mb with-lock` for documentation on creating buckets with
object locking enabled.
.. tab-set::
.. tab-item:: EXAMPLE
The following command returns the default object lock configuration for
the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc retention info --default myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] retention info \
[--default] \
[--recursive] \
[--rewind "string"] \
[--version-id "string"]* \
[--versions] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
:mc-cmd-option:`mc retention info version-id` is mutually exclusive with
multiple other parameters. See the reference documentation for more
information.
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required*
The full path to the object for which to retreive
the object lock configuration. Specify the :ref:`alias <alias>` of a
configured S3-compatible service as the prefix to the ``ALIAS`` bucket
path. For example:
.. code-block:: shell
mc retention info play/mybucket/object.txt
- If the ``ALIAS`` specifies a bucket or bucket prefix, include
:mc-cmd-option:`~mc retention info recursive` to return the object
lock settings for all objects in the bucket or bucket prefix.
- If the ``ALIAS`` bucket has versioning enabled,
:mc-cmd:`mc retention info` by default applies to only the latest object
version. Use :mc-cmd-option:`~mc retention info version-id` or
:mc-cmd-option:`~mc retention info versions` to return the object lock
settings for a specific version or for all versions of the object.
.. mc-cmd:: default
:option:
*Optional* Returns the default object lock settings for the bucket specified
to :mc-cmd:`~mc retention info ALIAS`.
If specifying :mc-cmd-option:`~mc retention info default`,
:mc-cmd:`mc retention info` ignores all other flags.
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively returns the object lock settings for all objects in the
specified :mc-cmd:`~mc retention info ALIAS` path.
Mutually exclusive with :mc-cmd-option:`~mc retention info version-id`.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Mutually exclusive with any of the following flags:
- :mc-cmd-option:`~mc retention info versions`
- :mc-cmd-option:`~mc retention info rewind`
- :mc-cmd-option:`~mc retention info recursive`
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc retention info versions` and
:mc-cmd-option:`~mc retention info rewind` together to retrieve the
retention settings for all object versions that existed at a
specific point-in-time.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Retrieve Object Lock Settings for an Object or Object(s)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Specific Object
.. code-block:: shell
:class: copyable
mc retention info ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc retention info ALIAS>` with the
:mc:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc retention info ALIAS>` with the path to the
object.
.. tab-item:: Multiple Objects
Use :mc-cmd:`mc retention info` with
:mc-cmd-option:`~mc retention info recursive` to retrieve the retention
settings for all objects in a bucket:
.. code-block:: shell
:class: copyable
mc retention info --recursive ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc retention info ALIAS>` with the
:mc:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc retention info ALIAS>` with the path to the
bucket.
.. include:: /includes/facts-locking.rst
:start-after: start-command-requires-locking-desc
:end-before: end-command-requires-locking-desc
Retrieve Default Object Lock Settings for a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc retention info` with
:mc-cmd-option:`~mc retention info default` to retrieve the default
object lock settings for a bucket:
.. code-block:: shell
:class: copyable
mc retention info --default ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc retention info ALIAS>` with the
:mc:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc retention info ALIAS>` with the path to the
bucket.
.. include:: /includes/facts-locking.rst
:start-after: start-command-requires-locking-desc
:end-before: end-command-requires-locking-desc
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,350 @@
.. _minio-bucket-locking:
====================
``mc retention set``
====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc retention
.. mc:: mc retention set
.. replacements for mc retention set
.. |command| replace:: :mc-cmd:`mc retention set`
.. |rewind| replace:: :mc-cmd-option:`~mc retention set rewind`
.. |versionid| replace:: :mc-cmd-option:`~mc retention set version-id`
.. |alias| replace:: :mc-cmd-option:`~mc retention set ALIAS`
.. |versions| replace:: :mc-cmd-option:`~mc retention set versions`
Syntax
------
.. start-mc-retention-desc
The :mc:`mc retention set` command configures the
:ref:`Write-Once Read-Many (WORM) locking <minio-object-locking>` settings for
an object or object(s) in a bucket. You can also set the default object lock
settings for a bucket, where all objects without explicit object lock settings
inherit the bucket default.
.. end-mc-retention-desc
To lock an object under :ref:`legal hold <minio-object-locking-legalhold>`,
use :mc:`mc legalhold`.
:mc:`mc retention set` *requires* that the specified bucket has object locking
enabled. You can **only** enable object locking at bucket creation. See
:mc-cmd-option:`mc mb with-lock` for documentation on creating buckets with
object locking enabled.
.. tab-set::
.. tab-item:: EXAMPLE
The following command sets a default 30 day
:ref:`GOVERNANCE <minio-object-locking-governance>` object lock on the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc retention set --default GOVERNANCE "30d" myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] retention set \
[--bypass] \
[--default] \
[--recursive] \
[--rewind "string"] \
[--versions] \
[--version-id "string"]* \
MODE \
"VALIDITY" \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
:mc-cmd-option:`mc retention set version-id` is mutually exclusive with
multiple other parameters. See the reference documentation for more
information.
Parameters
~~~~~~~~~~
.. mc-cmd:: MODE
Sets the locking mode for the :mc-cmd:`~mc retention set ALIAS`.
Specify one of the following supported values:
- ``governance``
- ``compliance``
See the AWS S3 documentation on :s3-docs:`Object Lock Overview
<object-lock-overview.html>` for more information on the supported
modes.
Requires specifying :mc-cmd:`~mc retention set VALIDITY`.
.. mc-cmd:: VALIDITY
The duration which objects remain in the specified
:mc-cmd:`~mc retention set MODE` after creation.
- For days, specify a string formatted as ``Nd``. For example,
``30d`` for 30 days after object creation.
- For years, specify a string formatted as ``Ny``. For example,
``1y`` for 1 year after object creation.
.. mc-cmd:: ALIAS
*Required*
The full path to the object or objects for which to set object lock
configuration. Specify the :ref:`alias <alias>` for the MinIO or
S3-compatible service and the full path to bucket. For
example:
.. code-block:: shell
mc retention set play/mybucket/object.txt MODE VALIDITY
- If the ``ALIAS`` specifies a bucket or bucket prefix, include
:mc-cmd-option:`~mc retention set recursive` to apply the object lock
settings to the bucket contents.
- :mc-cmd:`mc retention set` by default applies to only the latest object
version. Use :mc-cmd-option:`~mc retention set version-id` or
:mc-cmd-option:`~mc retention set versions` to apply the object lock
settings to a specific version or to all versions of the object
respectively.
.. mc-cmd:: bypass
:option:
*Optional* Allows a user with the ``s3:BypassGovernanceRetention`` permission
to modify the object. Requires the ``governance`` retention
:mc-cmd:`~mc retention set MODE`
.. mc-cmd:: default
:option:
*Optional* Sets the default object lock settings for the bucket specified to
:mc-cmd:`~mc retention set ALIAS` using the
:mc-cmd:`~mc retention set MODE` and :mc-cmd:`~mc retention set VALIDITY`.
Any objects created in the bucket inherit the default object lock settings
unless explicitly overriden using :mc-cmd:`mc retention set`.
If specifying :mc-cmd-option:`~mc retention set default`,
:mc-cmd:`mc retention set` ignores all other flags.
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively applies the object lock settings to all objects in the
specified :mc-cmd:`~mc retention set ALIAS` path.
Mutually exclusive with :mc-cmd-option:`~mc retention set version-id`.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Mutually exclusive with any of the following flags:
- :mc-cmd-option:`~mc retention set versions`
- :mc-cmd-option:`~mc retention set rewind`
- :mc-cmd-option:`~mc retention set recursive`
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc retention set versions` and
:mc-cmd-option:`~mc retention set rewind` together to apply the
retention settings to all object versions that existed at a
specific point-in-time.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Set Default Bucket Retention Settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc retention set` with the
:mc-cmd-option:`~mc retention set recursive` and
:mc-cmd-option:`~mc retention set default` to set the default bucket
retention settings.
.. code-block:: shell
:class: copyable
mc retention set --recursive --default MODE DURATION ALIAS/PATH
- Replace :mc-cmd:`MODE <mc retention set MODE>` with the retention mode to
enable. MinIO supports the AWS S3 retention modes ``governance`` and
``compliance``.
- Replace :mc-cmd:`DURATION <mc retention set VALIDITY>` with the duration which
the object lock should remain in effect. For example, to set a retention
period of 30 days, specify ``30d``.
- Replace :mc-cmd:`ALIAS <mc retention set ALIAS>` with the
:mc:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc retention set ALIAS>` with the path to the bucket.
.. include:: /includes/facts-locking.rst
:start-after: start-command-requires-locking-desc
:end-before: end-command-requires-locking-desc
Set Object Lock Configuration for Versioned Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Specific Version
Use :mc-cmd:`mc retention set` with
:mc-cmd-option:`~mc retention set version-id` to apply the retention
settings to a specific object version:
.. code-block:: shell
:class: copyable
mc retention set --version-id VERSION MODE DURATION ALIAS/PATH
- Replace :mc-cmd:`VERSION <mc retention set version-id>` with the version
of the object.
- Replace :mc-cmd:`MODE <mc retention set MODE>` with the retention mode
to enable. MinIO supports the AWS S3 retention modes ``governance`` and
``compliance``.
- Replace :mc-cmd:`DURATION <mc retention set VALIDITY>` with the duration
which the object lock should remain in effect. For example, to set a
retention period of 30 days, specify ``30d``.
- Replace :mc-cmd:`ALIAS <mc retention set ALIAS>` with the
:mc:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc retention set ALIAS>` with the path to the
object.
.. tab-item:: All Versions
Use :mc-cmd:`mc retention set` with
:mc-cmd-option:`~mc retention set versions` to apply the retention
settings to a specific object version:
.. code-block:: shell
:class: copyable
mc retention set --versions MODE DURATION ALIAS/PATH
- Replace :mc-cmd:`MODE <mc retention set MODE>` with the retention mode
to enable. MinIO supports the AWS S3 retention modes ``governance`` and
``compliance``.
- Replace :mc-cmd:`DURATION <mc retention set VALIDITY>` with the duration
which the object lock should remain in effect. For example, to set a
retention period of 30 days, specify ``30d``.
- Replace :mc-cmd:`ALIAS <mc retention set ALIAS>` with the
:mc:`alias <mc alias>` of a configured S3-compatible host.
- Replace :mc-cmd:`PATH <mc retention set ALIAS>` with the path to the
object.
.. include:: /includes/facts-locking.rst
:start-after: start-command-requires-locking-desc
:end-before: end-command-requires-locking-desc
Behavior
--------
Retention of Object Versions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For buckets with :mc:`versioning enabled <mc version>`, :mc:`mc retention set`
by default operates on the *latest* version of the target object or object(s).
:mc:`mc retention set` includes specific options that when *explicitly*
specified direct the command to operate on either a specific object version *or*
all versions of an object:
.. tab-set::
.. tab-item:: Specific Object Version
To direct :mc:`mc retention set` to operate on a specific version of an
object, include the ``--version-id`` argument:
- :mc-cmd-option:`mc retention set version-id`
- :mc-cmd-option:`mc retention set version-id`
- :mc-cmd-option:`mc retention set version-id`
.. tab-item:: All Object Versions
To direct :mc:`mc retention set` to operate on *all* versions of an object,
include the ``--versions`` argument:
- :mc-cmd-option:`mc retention set versions`
- :mc-cmd-option:`mc retention set versions`
- :mc-cmd-option:`mc retention set versions`
Interaction with Legal Holds
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Locking an object prevents any modification or deletion of that
object, similar to the :mc-cmd:`COMPLIANCE <mc retention set MODE>` object
locking mode. Objects can have simultaneous retention-based locks *and*
legal hold locks.
The legal hold lock *overrides* any retention locking, such that an object under
legal hold remains locked *even if* the retention period expires. Setting,
modifying, or clearing retention settings for an object under legal hold has no
effect until the legal hold either expires or is explicitly disabled.
For more information on object legal holds, see :mc-cmd:`mc legalhold`.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,411 @@
=========
``mc rm``
=========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc rm
.. |command| replace:: :mc-cmd:`mc rm`
.. |rewind| replace:: :mc-cmd-option:`~mc rm rewind`
.. |versions| replace:: :mc-cmd-option:`~mc rm versions`
.. |versionid| replace:: :mc-cmd-option:`~mc rm version-id`
.. |alias| replace:: :mc-cmd-option:`~mc rm ALIAS`
Syntax
------
.. start-mc-rm-desc
The :mc:`mc rm` command removes objects from a bucket on a MinIO deployment.
To completely remove a bucket, use :mc:`mc rb` instead.
.. end-mc-rm-desc
You can also use :mc:`mc rm` against the local filesystem to produce similar
results to the ``rm`` commandline tool.
.. important::
:mc:`mc rm` supports removing multiple objects *or* files in a single
command. Consider using the :mc-cmd-option:`~mc rm fake`
option to validate that the operation targets only the desired objects/files.
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes multiple objects from the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc rm --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] rm \
[--bypass] \
[--dangerous] \
[--fake] \
[--force]* \
[--incomplete] \
[--newer-than "string"] \
[--non-current] \
[--older-than "string"] \
[--recursive] \
[--rewind "string"] \
[--stdin] \
[--version-id "string"]* \
[--versions] \
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
:mc-cmd-option:`mc rm force` is required by multiple parameters.
:mc-cmd-option:`mc rm version-id` is mutually exclusive with multiple
parameters. See the reference documentation for more information.
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO deplyment and the full path to
the object to remove. For example:
.. code-block:: shell
mc rm play/mybucket/object.txt
You can specify multiple objects on the same or different MinIO deployments.
For example:
.. code-block:: shell
mc rm play/mybucket/object.txt play/mybucket/otherobject.txt
If specifying the path to a bucket or bucket prefix, you **must** also
specify the :mc-cmd-option:`~mc rm recursive` and
:mc-cmd-option:`~mc rm force` arguments. For example:
.. code-block:: shell
mc rm --recursive --force play/mybucket/
mc rm --recursive --force play/mybucket/myprefix/
Consider first running the command with the
:mc-cmd-option:`~mc rm fake` flag to validate the scope of the
recursive delete operation.
For removing a file from a local filesystem, specify the full path to that
file:
.. code-block:: shell
mc rm ~/data/myoldobject.txt
.. mc-cmd:: bypass
:option:
*Optional* Allows removing an object held under
:ref:`GOVERNANCE <minio-object-locking-governance>` object locking.
.. mc-cmd:: dangerous
:option:
*Optional* Allows running :mc:`mc rm` when the :mc-cmd:`~mc rm ALIAS`
specifies the root (all buckets) on the MinIO deployment.
When combined with :mc-cmd-option:`~mc rm versions`, this flag
directs :mc-cmd:`mc rm` to permanently remove all objects *and* versions from
the ``ALIAS`` target.
Consider first running the command with the :mc-cmd-option:`~mc rm fake` to
validate the scope of the site-wide delete operation.
.. warning::
Running :mc-cmd-option:`mc rm dangerous` with the
:mc-cmd-option:`~mc rm versions` flag is irreversible. Exercise all
possible due diligence in ensuring the command applies to only the desired
``ALIAS`` targets prior to execution.
.. mc-cmd:: encrypt-key
:option:
*Optional* The encryption key to use for performing Server-Side Encryption
with Client Keys (SSE-C). Specify comma seperated key-value pairs as
``KEY=VALUE,...``.
- For ``KEY``, specify the S3-compatible service
:mc-cmd:`alias <mc alias>` and full path to the bucket, including any
bucket prefixes. Separate the alias and bucket path with a forward slash
``\``. For example, ``play/mybucket``
- For ``VALUE``, specify the data key to use for encryption object(s) in
the bucket or bucket prefix specified to ``KEY``.
:mc-cmd-option:`~mc rm encrypt-key` can use the ``MC_ENCRYPT_KEY``
environment variable for populating the list of encryption key-value
pairs as an alternative to specifying them on the command line.
.. mc-cmd:: fake
:option:
*Optional* Perform a fake remove operation. Use this operation to perform
validate that the :mc:`mc rm` operation will only
remove the desired objects or buckets.
.. mc-cmd:: force
:option:
*Optional* Allows running :mc:`mc rm` with any of the following arguments:
- :mc-cmd-option:`~mc rm recursive`
- :mc-cmd-option:`~mc rm versions`
- :mc-cmd-option:`~mc rm stdin`
.. mc-cmd:: incomplete, I
:option:
*Optional* Remove incomplete uploads for the specified object.
If any :mc-cmd-option:`~mc rm ALIAS` specifies a bucket,
you **must** also specify :mc-cmd-option:`~mc rm recursive`
and :mc-cmd-option:`~mc rm force`.
.. mc-cmd:: newer-than
:option:
*Optional* Remove object(s) newer than the specified number of days. Specify
a string in ``#d#hh#mm#ss`` format. For example: ``--newer-than 1d2hh3mm4ss``
Defaults to ``0`` (all objects).
.. mc-cmd:: non-current
:option:
*Optional* Removes all :ref:`non-current <minio-bucket-versioning-delete>`
object versions from the specified :mc-cmd:`~mc rm ALIAS`.
This option has on effect on buckets without
:ref:`versioning <minio-bucket-versioning>` enabled.
.. mc-cmd:: older-than
:option:
*Optional* Remove object(s) older than the specified time limit. Specify a
string in ``#d#hh#mm#ss`` format. For example: ``--older-than 1d2hh3mm4ss``.
Defaults to ``0`` (all objects).
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively remove the contents of each :mc-cmd:`~mc rm ALIAS`
bucket or bucket prefix.
If specifying :mc-cmd-option:`~mc rm recursive`, you **must** also
specify :mc-cmd-option:`~mc rm force`.
For buckets with :ref:`versioning <minio-bucket-versioning>` enabled,
this option by default produces a delete marker for each removed object.
Include the :mc-cmd-option:`~mc rm versions` flag to recursively remove
all objects *and* object versions from the bucket.
Consider first running the command with the
:mc-cmd-option:`~mc rm fake` flag to validate the scope of the
recursive delete operation.
Mutually exclusive with :mc-cmd-option:`mc rm version-id`
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: stdin
:option:
*Optional* Read object names or buckets from ``STDIN``.
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc rm versions` and
:mc-cmd-option:`~mc rm rewind` together to remove all object
versions which existed at a specific point in time.
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Mutually exclusive with any of the following flags:
- :mc-cmd-option:`~mc rm versions`
- :mc-cmd-option:`~mc rm rewind`
- :mc-cmd-option:`~mc rm recursive`
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Remove a Single Object
~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: shell
:class: copyable
mc rm ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc rm ALIAS>` with the :mc:`alias <mc alias>` of
a configured S3-compatible service.
- Replace :mc-cmd:`PATH <mc rm ALIAS>` with the path to the object.
Recursively Remove a Bucket's Contents
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc rm` with the
:mc-cmd-option:`~mc rm recursive` and :mc-cmd-option:`~mc rm force` options
to recursively remove a bucket's contents.
.. code-block:: shell
:class: copyable
mc rm --recursive --force ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc rm ALIAS>` with the :mc:`alias <mc alias>` of
a configured S3-compatible service.
- Replace :mc-cmd:`PATH <mc rm ALIAS>` with the path to the bucket.
This operation does *not* remove the bucket. Use :mc:`mc rb` to remove the
bucket along with all contents and associated configurations.
Remove All Incomplete Upload Files for an Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc rm` with the :mc-cmd-option:`~mc rm incomplete` option to remove
incomplete upload files for an object.
.. code-block:: shell
:class: copyable
mc rm --recursive --force ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc rm ALIAS>` with the :mc:`alias <mc alias>` of
a configured S3-compatible service.
- Replace :mc-cmd:`PATH <mc rm ALIAS>` with the path to the object.
Removing incomplete upload files prevents resuming the upload using the
:mc-cmd-option:`mc mv continue` or :mc-cmd-option:`mc cp continue` commands.
Roll Object Back To Previous Version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc rm` with :mc-cmd-option:`~mc rm versions` and
:mc-cmd-option:`~mc rm newer-than` to
remove all object versions newer than the specified duration of time. This
effectively "rolls back" the object to its state at that time.
.. important::
Removing specific versions of an object is a *destructive* action. You cannot
restore the deleted object versions.
.. code-block:: shell
:class: moveable
mc rm ALIAS/PATH --versions --newer-than DURATION
- Replace :mc-cmd:`ALIAS <mc rm ALIAS>` with the :mc:`alias <mc alias>` of
a configured S3-compatible service.
- Replace :mc-cmd:`PATH <mc rm ALIAS>` with the path to the object. For
example, ``/mybucket/myobject``.
- Replace :mc-cmd:`DURATION <mc rm newer-than>` with the number of days in the
past from the current host time from which the operation begins removing
versions of the object. For example, to remove all versions of the object
created in the last 30 days, specify ``"30d"``.
Behavior
--------
Deleting Bucket Contents
~~~~~~~~~~~~~~~~~~~~~~~~
Using :mc:`mc rm` to remove all contents in a bucket does not delete the bucket
itself. Any configurations associated to the bucket remain in place, such as
:mc-cmd-option:`default object lock settings <mc retention set default>`.
To completely remove a bucket, use :mc:`mc rb` instead of :mc:`mc rm`.
MinIO Trims Empty Prefixes on Object Removal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. include:: /includes/common-admonitions.rst
:start-after: start-remove-api-trims-prefixes
:end-before: end-remove-api-trims-prefixes
.. include:: /includes/common-admonitions.rst
:start-after: start-remove-api-trims-prefixes-fs
:end-before: end-remove-api-trims-prefixes-fs
Delete Operations in Versioned Buckets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO supports keeping multiple :ref:`versions <minio-bucket-versioning>` of an
object in a single bucket. :ref:`Deleting <minio-bucket-versioning-delete>` an
object in a versioned bucket results in a special ``DeleteMarker`` tombstone
that marks an object as deleted while retaining all previous versions of that
object.
- To remove a specific object version from a bucket, use
:mc-cmd-option:`mc rm version-id`
- To remove all versions of an object from a bucket, use
:mc-cmd-option:`mc rm versions`
- To remove all non-current versions of an object from a bucket, use
:mc-cmd-option:`mc rm non-current`
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,185 @@
=====================
``mc share download``
=====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc share download
.. |command| replace:: :mc-cmd:`mc share download`
.. |versionid| replace:: :mc-cmd-option:`~mc share download version-id`
.. |alias| replace:: :mc-cmd-option:`~mc share download ALIAS`
Syntax
------
.. start-mc-share-download-desc
The :mc:`mc share download` command generates a temporary presigned URL with
integrated access credentials for downloading objects from a MinIO bucket. The
temporary URL expires after a configurable time limit.
.. end-mc-share-download-desc
- Applications can perform a ``GET`` to retrieve the object from the URL.
- Users can open the URL in a browser to download the object.
For more information on shareable object URLs, see the Amazon S3
documentation on :aws-docs:`Pre-Signed URLs
<AmazonS3/latest/dev/ShareObjectPreSignedURL.html>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command generates a new presigned download URL for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc share download --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] share upload \
[--expire "string"] \
[--recursive] \
[--version-id "string"] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO deplyment and the full path to
the object for which to generate a download URL. For example:
.. code-block:: shell
mc share download play/mybucket/object.txt
You can specify multiple objects on the same or different MinIO deployments.
For example:
.. code-block:: shell
mc share download play/mybucket/object.txt play/mybucket/otherobject.txt
If specifying the path to a bucket or bucket prefix, you **must** also
specify the :mc-cmd-option:`~mc share download recursive` argument. For
example:
.. code-block:: shell
mc share download --recursive play/mybucket/
mc share download --recursive play/mybucket/myprefix/
.. mc-cmd:: expire, E
:option:
*Optional* Set the expiration time limit for all generated URLs.
Specify a string with format ``##h##m##s`` format. For example:
``12h34m56s`` for an expiry of 12 hours, 34 minutes, and 56 seconds
after URL generation.
Defaults to ``168h`` or 168 hours (7 days).
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively generate URLs for all objects in a
:mc-cmd:`mc share download ALIAS` bucket or bucket prefix.
Required if any ``ALIAS`` specifies a path to a bucket or bucket prefix.
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Generate a URL to Download Object(s)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Get Specific Object
Use :mc-cmd:`mc share download` to generate a URL that supports
``GET`` requests for an object:
.. code-block:: shell
:class: copyable
mc share download --expire DURATION ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc share download ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc share download ALIAS>` with the path to the
object on the MinIO deployment.
- Replace :mc-cmd:`DURATION <mc share download expire>` with the duration
after which the URL expires. For example, to set a 30 day expiry,
specify ``30d``.
.. tab-item:: Get Object(s) in a Bucket
Use :mc-cmd:`mc share download` with the
:mc-cmd-option:`~mc share download recursive` option to generate a URL for
each object in a bucket. Each URL supports ``GET`` requests for its
associated object:
.. code-block:: shell
:class: copyable
mc share download --recursive --expire DURATION ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc share download ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc share download ALIAS>` with the path to the
bucket or bucket prefix on the MinIO deployment.
- Replace :mc-cmd:`DURATION <mc share download expire>` with the duration
after which the URL expires. For example, to set a 30 day expiry,
specify ``30d``.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,131 @@
===================
``mc share list``
===================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc share list
Syntax
-----------
.. start-mc-share-upload-desc
The :mc:`mc share list` command displays any unexpired presigned URLs generated
by :mc-cmd:`mc share upload` or :mc-cmd:`mc share download`
.. end-mc-share-upload-desc
Applications can perform a ``PUT`` to retrieve the object from the URL.
For more information on shareable object URLs, see the Amazon S3
documentation on :aws-docs:`Pre-Signed URLs
<AmazonS3/latest/dev/ShareObjectPreSignedURL.html>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command lists all upload and download presigned URLs
respectively for the ``mydata`` bucket on the ``myminio`` MinIO
deployment:
.. code-block:: shell
:class: copyable
mc share list upload myminio/mydata
mc share list download myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] share list \
[download | upload] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: download
*Required* Lists all unexpired presigned download (``GET``) URLs.
Mutually exclusive with :mc-cmd-option:`mc share list upload`
.. mc-cmd:: upload
*Required* Lists all unexpired presigned upload (``PUT``) URLs.
Mutually exclusive with :mc-cmd-option:`mc share list download`
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO deplyment and the full path to
the object for which to list unexpired presigned URLs.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List Generated Download and Upload URLs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: List Active Download Presigned URLs
Use :mc-cmd:`mc share list download` to generate a URL
that supports ``POST`` requests for uploading a file to a specific object
location on an S3-compatible host:
.. code-block:: shell
:class: copyable
mc share list download ALIAS
- Replace :mc-cmd:`ALIAS <mc share list ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
.. tab-item:: List Active Upload Presigned URLs
Use :mc-cmd:`mc share list upload` to generate a URL that
supports ``POST`` requests for uploading a file to a specific object
location on an S3-compatible host:
.. code-block:: shell
:class: copyable
mc share list upload ALIAS
- Replace :mc-cmd:`ALIAS <mc share upload ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,209 @@
===================
``mc share upload``
===================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc share upload
Syntax
-----------
.. start-mc-share-upload-desc
The :mc:`mc share upload` command generates a temporary presigned URL with
integrated access credentials for downloading objects from a MinIO bucket. The
temporary URL expires after a configurable time limit.
.. end-mc-share-upload-desc
Applications can perform a ``PUT`` to retrieve the object from the URL.
For more information on shareable object URLs, see the Amazon S3
documentation on :aws-docs:`Pre-Signed URLs
<AmazonS3/latest/dev/ShareObjectPreSignedURL.html>`.
.. tab-set::
.. tab-item:: EXAMPLE
The following command generates a new presigned upload URL for the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc share upload --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] share upload \
[--expire "string"] \
[--recursive] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO deplyment and the full path to
the object for which to generate an upload URL. For example:
.. code-block:: shell
mc share upload play/mybucket/object.txt
You can specify multiple objects on the same or different MinIO deployments.
For example:
.. code-block:: shell
mc share upload play/mybucket/object.txt play/mybucket/otherobject.txt
If specifying the path to a bucket or bucket prefix, you **must** also
specify the :mc-cmd-option:`~mc share upload recursive` argument. For
example:
.. code-block:: shell
mc share upload --recursive play/mybucket/
mc share upload --recursive play/mybucket/myprefix/
.. mc-cmd:: expire, E
:option:
*Optional* Set the expiration time limit for all generated URLs.
Specify a string with format ``##h##m##s`` format. For example:
``12h34m56s`` for an expiry of 12 hours, 34 minutes, and 56 seconds
after URL generation.
Defaults to ``168h`` or 168 hours (7 days).
.. mc-cmd:: recursive, r
:option:
*Optional* Modifies the CURL URL to support uploading objects to a bucket or
bucket prefix. Required if any ``ALIAS`` specifies a path to a bucket or
bucket prefix. The modified CURL output resembles the following:
.. code-block:: shell
curl ... -F key=ALIAS/<NAME> -F file=@<FILE>
Replace ``<FILE>`` with the path to the file to upload.
Replace ``<NAME>`` with the file once uploaded.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Generate a URL to Upload Object(s)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tab-set::
.. tab-item:: Upload Single Object
Use :mc-cmd:`mc share upload` to generate a URL that supports
``POST`` requests for uploading a file to a specific object location
on a MinIO deployment:
.. code-block:: shell
:class: copyable
mc share upload --expire DURATION ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc share upload ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc share upload ALIAS>` with the path to the
object on the MinIO deployment.
- Replace :mc-cmd:`DURATION <mc share upload expire>` with the duration
after which the URL expires. For example, to set a 30 day expiry,
specify ``30d``.
.. tab-item:: Upload Multiple Objects
Use :mc-cmd:`mc share upload` with the
:mc-cmd-option:`~mc share upload recursive` option to generate a URL that
supports ``POST`` requests for uploading files to a bucket on a
MinIO deployment:
.. code-block:: shell
:class: copyable
mc share upload --recursive --expire DURATION ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc share upload ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc share upload ALIAS>` with the path to the
bucket or bucket prefix on the MinIO deployment.
- Replace :mc-cmd:`DURATION <mc share upload expire>` with the duration
after which the URL expires. For example, to set a 30 day expiry,
specify ``30d``.
The command returns a CURL command for uploading an object to the
specified bucket prefix.
- Replace the ``<FILE>`` string in the returned CURL command with the path
to the file to upload.
- Replace the ``<NAME>`` string in the returned CURL command with the name
of the file in the bucket.
You can use a shell script loop to recursively upload the contents of a
filesystem directory to the S3-compatible service:
.. code-block:: shell
#!/bin/sh
for file in ~/Documents/photos/
do
curl https://play.min.io/mybucket/ \
-F policy=AAAAA -F x-amz-algorithm=AWS4-HMAC-SHA256 \
-F x-amz-credential=AAAA/us-east-1/s3/aws4_request \
-F x-amz-date=20200812T202556Z \
-F x-amz-signature=AAAA \
-F bucket=mydata -F key=mydata/${file} -F file=@${file}
done
Defer to the documented best practices for your preferred scripting
language for iterating through files in a directory.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,330 @@
==========
``mc sql``
==========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc sql
Syntax
------
.. start-mc-sql-desc
The :mc:`mc sql` command provides an S3 Select interface for performing sql
queries on objects in the specified MinIO deployment.
.. end-mc-sql-desc
See :s3-docs:`Selecting content from objects
<selecting-content-from-objects>` for more information on S3 Select behavior
and limitations.
.. tab-set::
.. tab-item:: EXAMPLE
The following command queries all objects in the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc sql --recursive --query "select * from S3Object" myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] mc sql \
--query "string" \
[--csv-input "string"] \
[--compression "string"] \
[--csv-output "string"] \
[--csv-output-header "string"] \
[--encrypt-key "string"] \
[--json-input "string"] \
[--json-output "string"] \
[--recursive] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The full path to the bucket or object to run the SQL query
against. Specify the :ref:`alias <alias>` of a configured
S3 service as the prefix to the ``ALIAS`` path. For example:
.. code-block:: shell
mc sql [FLAGS] play/mybucket
.. mc-cmd:: query, e
:option:
*Required* The SQL statement to execute on the specified
:mc-cmd:`~mc sql ALIAS` directory or object. Wrap the entire SQL query in
double quotes ``"``.
Defaults to ``"select * from S3Object"``.
.. mc-cmd:: csv-input
:option:
*Optional* The data format for ``.csv`` input objects. Specify a string of
comma-seperated ``key=value,...`` pairs. See :ref:`mc-sql-csv-format` for
more information on valid keys.
.. mc-cmd:: compression
:option:
*Optional* The compression type of the input object. Specify one of the
following supported values:
- ``GZIP``
- ``BZIP2``
- ``NONE`` (default)
Compression schemes supported by MinIO backend only:
- ``ZSTD`` `Zstandard <https://facebook.github.io/zstd/>`__
- ``LZ4`` `LZ4 <https://lz4.github.io/lz4/>`__ stream
- ``S2`` `S2 <https://github.com/klauspost/compress/tree/master/s2#s2-compression>`__ framed stream
- ``SNAPPY`` `Snappy <http://google.github.io/snappy/>`__ framed stream
.. mc-cmd:: csv-output
:option:
*Optional* The data format for ``.csv`` output. Specify a string of
comma-seperated ``key=value,...`` pairs. See :ref:`mc-sql-csv-format` for
more information on valid keys.
See the S3 API :s3-api:`CSVOutput <API_CSVOutput.html>` for more
information.
.. mc-cmd:: csv-output-header
:option:
*Optional* The header row of the ``.csv`` output file. Specify a string of
comma-separated fields as ``field1,field2,...``.
Omit to output a ``.csv`` with no header row.
.. mc-cmd:: encrypt-key
:option:
*Optional* The encryption key to use for performing Server-Side Encryption
with Client Keys (SSE-C). Specify comma seperated key-value pairs as
``KEY=VALUE,...``.
- For ``KEY``, specify the MinIO deployment
:mc-cmd:`alias <mc alias>` and full path to the bucket, including any
bucket prefixes. Separate the alias and bucket path with a forward slash
``\``. For example, ``play/mybucket``
- For ``VALUE``, specify the data key to use for encryption object(s) in
the bucket or bucket prefix specified to ``KEY``.
:mc-cmd-option:`~mc sql encrypt-key` can use the ``MC_ENCRYPT_KEY``
environment variable for populating the list of encryption key-value
pairs as an alternative to specifying them on the command line.
.. mc-cmd:: json-input
:option:
*Optional* The data format for ``.json`` input objects. Specify the type of
the JSON contents as ``type=<VALUE>``. The value can be either:
- ``DOCUMENT`` - JSON `document <https://www.json.org/json-en.html>`__.
- ``LINES`` - JSON `lines <http://jsonlines.org/>`__.
See the S3 API :s3-api:`JSONInput <API_JSONInput.html>` for more
information.
.. mc-cmd:: json-output
:option:
*Optional* The data format for the ``.json`` output. Supports the
``rd=value`` key, where ``rd`` is the ``RecordDelimiter`` for the JSON
document.
Omit to use the default newline character ``\n``.
See the S3 API :s3-api:`JSONOutput <API_JSONOutput.html>` for more
information.
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively searches the specified :mc-cmd:`~mc sql ALIAS`
directory using the :mc-cmd-option:`~mc sql query` SQL statement.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Select all Columns in all Objects in a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc sql` with the :mc-cmd-option:`~mc sql recursive` and
:mc-cmd-option:`~mc sql query` options to apply the query to all objects
in a bucket:
.. code-block:: shell
:class: copyable
mc sql --recursive --query "select * from S3Object" ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc sql ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc sql ALIAS>` with the path to the bucket
on the MinIO deployment.
Run an Aggregation Query on an Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc:`mc sql` with the :mc-cmd-option:`~mc sql query` option to query
an object on an MinIO deployment:
.. code-block:: shell
mc sql --query "select count(s.power) from S3Object" ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc sql ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc sql ALIAS>` with the path to the object
on the MinIO deployment.
Behavior
--------
Input Formats
~~~~~~~~~~~~~
:mc:`mc sql` supports the following input formats:
- ``.csv``
- ``.json``
- ``.parquet``
For ``.csv`` file types, use :mc-cmd-option:`mc sql csv-input` to
specify the CSV data format. See :ref:`mc-sql-csv-format` for more
information on CSV formatting fields.
For ``.json`` file types, use :mc-cmd-option:`mc sql json-input` to specify
the JSON data format.
For ``.parquet`` file types, :mc-cmd:`mc sql` automatically interprets the
data format.
.. _mc-sql-csv-format:
CSV Formatting Fields
~~~~~~~~~~~~~~~~~~~~~
The following table lists valid key-value pairs for use with
:mc-cmd-option:`mc sql csv-input` and :mc-cmd-option:`mc sql csv-output`.
Certain key pairs are only valid for :mc-cmd-option:`~mc sql csv-input`
See the documentation for S3 API :s3-api:`CSVInput <API_CSVInput.html>` for more
information on S3 CSV formatting.
.. list-table::
:header-rows: 1
:widths: 20 20 60
:width: 100%
* - Key
- ``--csv-input`` Only
- Description
* - ``rd``
-
- The character that seperates each record (row) in the input ``.csv``
file.
Corresponds to ``RecordDelimiter`` in the S3 API ``CSVInput``.
* - ``fd``
-
- The character that seperates each field in a record. Defaults to
``,``.
Corresponds to ``FieldDelimeter`` in the S3 API ``CSVInput``.
* - ``qc``
-
- The character used for escaping when the ``fd`` character is part of
a value. Defaults to ``"``.
Corresponds to ``QuoteCharacter`` in the S3 API ``CSVInput``.
* - ``qec``
-
- The character used for escaping a quotation mark ``"`` character
inside an already escaped value.
Corresponds to ``QuoteEscapeCharacter`` in the S3 API ``CSVInput``.
* - ``fh``
- Yes
- The content of the first line in the ``.csv`` file.
Specify one of the following supported values:
- ``NONE`` - The first line is not a header.
- ``IGNORE`` - Ignore the first line.
- ``USE`` - The first line is a header.
For ``NONE`` or ``IGNORE``, you must specify column positions
``_#`` to identify a column in the :mc-cmd-option:`~mc sql query`
statement.
For ``USE``, you can specify header values to identify a column in
the :mc-cmd-option:`~mc sql query` statement.
Corresponds to ``FieldHeaderInfo`` in the S3 API ``CSVInput``.
* - ``cc``
- Yes
- The character used to indicate a record should be ignored. The
character *must* appear at the beginning of the record.
Corresponds to ``Comment`` in the S3 API ``CSVInput``.
* - ``qrd``
- Yes
- Specify ``TRUE`` to indicate that fields may contain record delimiter
values (``rd``).
Defaults to ``FALSE``.
Corresponds to ``AllowQuotedRecordDelimiter`` in the S3 API
``CSVInput``.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,195 @@
===========
``mc stat``
===========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc stat
.. |command| replace:: :mc-cmd:`mc stat`
.. |rewind| replace:: :mc-cmd-option:`~mc stat rewind`
.. |versions| replace:: :mc-cmd-option:`~mc stat versions`
.. |versionid| replace:: :mc-cmd-option:`~mc stat version-id`
.. |alias| replace:: :mc-cmd-option:`~mc stat ALIAS`
Syntax
-----------
.. start-mc-stat-desc
The :mc:`mc stat` command displays information on objects in a MinIO bucket,
including object metadata.
.. end-mc-stat-desc
You can also use :mc:`mc stat` against the local filesystem to produce similar
results to the ``stat`` commandline tool.
.. tab-set::
.. tab-item:: EXAMPLE
The following command displays information on all objects in the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc stat --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] stat \
[--encrypt-key "value"] \
[--recursive] \
[--rewind "string"] \
[--versions] \
[--version-id "string"]* \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
:mc-cmd-option:`mc stat version-id` is mutually exclusive with multiple
parameters. See the reference documentation for more information.
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
The :ref:`alias <alias>` of a MinIO deployment and the full path to the
object for which to retrieve detailed information. For example:
.. code-block:: shell
mc stat myminio/mybucket/myobject.txt
You can specify multiple objects on the same or different MinIO deployments:
.. code-block:: shell
mc stat play/mybucket/myobject.txt myminio/mybucket/myobject.txt
If specifying the path to a bucket or bucket prefixy, you **must**
include the :mc-cmd-option:`mc stat recursive` flag:
.. code-block:: shell
mc stat --recursive myminio/mybucket/
For retrieving information on a file from a local filesystem, specify the
full path to that file:
.. code-block:: shell
mc stat ~/data/myobject.txt
.. mc-cmd:: encrypt-key
:option:
*Optional* Encrypt or decrypt objects using server-side encryption with
client-specified keys. Specify key-value pairs as ``KEY=VALUE``.
- Each ``KEY`` represents a bucket or object.
- Each ``VALUE`` represents the data key to use for encrypting
object(s).
Enclose the entire list of key-value pairs passed to
:mc-cmd-option:`~mc stat encrypt-key` in double quotes ``"``.
:mc-cmd-option:`~mc stat encrypt-key` can use the ``MC_ENCRYPT_KEY``
environment variable for retrieving a list of encryption key-value pairs
as an alternative to specifying them on the command line.
.. mc-cmd:: recursive, r
:option:
*Optional* Recursively :mc:`mc stat` the contents of the MinIO bucket
specified to :mc-cmd:`~mc stat ALIAS`.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc stat versions` and
:mc-cmd-option:`~mc stat rewind` together to remove all object
versions which existed at a specific point in time.
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Mutually exclusive with any of the following flags:
- :mc-cmd-option:`~mc stat versions`
- :mc-cmd-option:`~mc stat rewind`
- :mc-cmd-option:`~mc stat recursive`
Examples
--------
.. tab-set::
.. tab-item:: Single Object
.. code-block:: shell
:class: copyable
mc stat ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc stat ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc stat ALIAS>` with the path to the bucket
or object on the S3-compatible host.
.. tab-item:: Object(s) in Bucket
Use :mc:`mc stat` with the :mc-cmd-option:`~mc stat recursive` option
to apply the operation to all objects in the bucket:
.. code-block:: shell
:class: copyable
mc stat --recursive ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc stat ALIAS>` with the
:mc:`alias <mc alias>` of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc stat ALIAS>` with the path to the bucket
or object on the S3-compatible host.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,139 @@
.. _minio-mc-tag-list:
===============
``mc tag list``
===============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc tag list
.. |command| replace:: :mc-cmd:`mc tag list`
.. |rewind| replace:: :mc-cmd-option:`~mc tag list rewind`
.. |versions| replace:: :mc-cmd-option:`~mc tag list versions`
.. |versionid| replace:: :mc-cmd-option:`~mc tag list version-id`
.. |alias| replace:: :mc-cmd-option:`~mc tag list ALIAS`
Syntax
------
.. start-mc-tag-list-desc
The :mc:`mc tag list` command lists all tags from a bucket or object.
.. end-mc-tag-list-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command lists tags for the ``mydata`` bucket on the
``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc tag list myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] tag set \
[--rewind "string"] \
[--versions] \
[--version-id "string"]* \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
:mc-cmd-option:`mc tag list version-id` is mutually exclusive with
multiple parameters. See the reference documentation for more information.
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` for a MinIO deployment and the
full path to the object for which to list all tags (e.g. bucket and path to
object). For example:
.. code-block:: none
mc tag list myminio/mybucket/object.txt
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc tag list versions` and
:mc-cmd-option:`~mc tag list rewind` together to list tags from all
object versions which existed at a specific point in time.
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Mutually exclusive with the following parameters:
- :mc-cmd-option:`~mc tag list rewind`
- :mc-cmd-option:`~mc tag list versions`
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
List Tags for a Bucket or Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc tag list` to list tags for a bucket or object:
.. code-block:: shell
:class: copyable
mc tag list ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc tag list ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc tag list ALIAS>` with the path to the bucket
or object on the MinIO deployment.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,138 @@
.. _minio-mc-tag-remove:
=================
``mc tag remove``
=================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc tag remove
.. |command| replace:: :mc-cmd:`mc tag remove`
.. |rewind| replace:: :mc-cmd-option:`~mc tag remove rewind`
.. |versions| replace:: :mc-cmd-option:`~mc tag remove versions`
.. |versionid| replace:: :mc-cmd-option:`~mc tag remove version-id`
.. |alias| replace:: :mc-cmd-option:`~mc tag remove ALIAS`
Syntax
------
.. start-mc-tag-remove-desc
The :mc:`mc tag remove` command removes all tags from a bucket or object.
.. end-mc-tag-remove-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command removes tags for the ``mydata`` bucket on the
``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc tag remove myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] tag remove \
[--rewind "string"] \
[--versions] \
[--version-id "string"]* \
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
:mc-cmd-option:`mc tag remove version-id` is mutually exclusive with
multiple parameters. See the reference documentation for more information.
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` for a MinIO deployment and the
full path to the object on which to remove all tags (e.g. bucket and path to
object). For example:
.. code-block:: none
mc tag remove myminio/mybucket/object.txt
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc tag remove versions` and
:mc-cmd-option:`~mc tag remove rewind` together to remove tags from all
object versions which existed at a specific point in time.
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Mutually exclusive with the following parameters:
- :mc-cmd-option:`~mc tag remove rewind`
- :mc-cmd-option:`~mc tag remove versions`
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Remove Tags from a Bucket or Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc tag remove` to remove tags from a bucket or object:
.. code-block:: shell
:class: copyable
mc tag remove ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc tag remove ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc tag remove ALIAS>` with the path to the bucket
or object on the MinIO deployment.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,155 @@
.. _minio-mc-tag-set:
==============
``mc tag set``
==============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc tag
.. mc:: mc tag set
.. |command| replace:: :mc-cmd:`mc tag set`
.. |rewind| replace:: :mc-cmd-option:`~mc tag set rewind`
.. |versions| replace:: :mc-cmd-option:`~mc tag set versions`
.. |versionid| replace:: :mc-cmd-option:`~mc tag set version-id`
.. |alias| replace:: :mc-cmd-option:`~mc tag set ALIAS`
Syntax
------
.. start-mc-tag-set-desc
The :mc:`mc tag set` command sets one or more tags to a bucket or object.
.. end-mc-tag-set-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command sets tags for the ``mydata`` bucket on the
``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc tag set myminio/mydata "tag1=value1&tag2=value2"
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] tag set \
[--rewind "string"] \
[--versions] \
[--version-id "string"]* \
ALIAS \
"TAGS"
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
:mc-cmd-option:`mc tag set version-id` is mutually exclusive with
multiple parameters. See the reference documentation for more information.
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` for a MinIO deployment and the
full path to the object on which to apply the tag (e.g. bucket and path to
object). For example:
.. code-block:: none
mc tag set myminio/mybucket/object.txt
.. mc-cmd:: TAGS
*Required* An ampersand-seperated (``&``) list of key-value pairs
(``KEY=VALUE``), where each pair represents one tag to assign to the object.
For example:
.. code-block:: none
mc tag set myminio/mybucket/object.txt "key1=value1&key2=value2"
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
.. mc-cmd:: versions
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-versions-desc
:end-before: end-versions-desc
Use :mc-cmd-option:`~mc tag set versions` and
:mc-cmd-option:`~mc tag set rewind` together to apply the tag all object
versions which existed at a specific point in time.
.. mc-cmd:: version-id, vid
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-version-id-desc
:end-before: end-version-id-desc
Mutually exclusive with the following parameters:
- :mc-cmd-option:`~mc tag set rewind`
- :mc-cmd-option:`~mc tag set versions`
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
Apply Tags to a Bucket or Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc tag set` to apply tags to a bucket or object:
.. code-block:: shell
:class: copyable
mc tag set ALIAS/PATH "TAGS"
- Replace :mc-cmd:`ALIAS <mc tag set ALIAS>` with the
:ref:`alias <alias>` of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc tag set ALIAS>` with the path to the bucket
or object on the MinIO deployment.
- Replace :mc-cmd:`TAGS <mc tag set TAGS>` with one or more ampersand-separated
(``&``) key-value pairs for each tag and its corresponding value.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,78 @@
..
Use this file as a template for adding new MinIO `mc` commands and
subcommands.
.. _minio-mc-COMMAND:
============================
``mc COMMAND``
============================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc COMMAND
Syntax
------
.. start-mc-COMMAND-desc
The :mc:`mc COMMAND` command DESCRIPTION
.. end-mc-COMMAND-desc
.. code-block:: shell
mc [GLOBALFLAGS] COMMAND FLAGS [FLAGS] ARGUMENTS [ARGUMENTS]
Parameters
~~~~~~~~~~
..
Document all arguments here:
.. mc-cmd:: ARGUMENT
*Required|Optional* Describe the argument here
..
Document all flags here
.. mc-cmd:: FLAG
*Required|Optional* Describe the flag here
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-globals
:end-before: end-minio-mc-globals
Examples
--------
..
Document all examples here
Use action-based titles:
Enable | Configure | Modify | Deploy | Set
Behavior
--------
..
Document all behaviors here
Be descriptive to improve searchability / SEO

View File

@ -0,0 +1,128 @@
===========
``mc tree``
===========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc tree
.. |command| replace:: :mc-cmd:`mc tree`
.. |rewind| replace:: :mc-cmd-option:`~mc tree rewind`
.. |alias| replace:: :mc-cmd-option:`~mc tree ALIAS`
Syntax
------
.. start-mc-tree-desc
The :mc:`mc tree` command lists all prefixes inside a MinIO bucket in a tree
format. The command optionally supports listing all objects inside of bucket
at each prefix, including the bucket root.
.. end-mc-tree-desc
You can also use :mc:`mc tree` against a local filesystem directory to
produce similar results to the ``tree`` commandline tool.
.. tab-set::
.. tab-item:: EXAMPLE
The following command prints a complete tree of all objects at any
depth in the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc tree --files myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] tree \
[--depth int] \
[--files] \
[--rewind "string"] \
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO deployment and the
full path to the bucket to list the tree hierarchy. For example:
.. code-block:: shell
mc tree myminio/mybucket
You can specify multiple targets to The command command. For
example:
.. code-block:: shell
mc tree myminio/mybucket myminio/myotherbucket
For retrieving the tree heirarchy of a local filesystem directory,
specify the full path to that directory. For example:
.. code-block:: shell
mc tree ~/minio/mydata/
.. mc-cmd:: depth, d
:option:
*Optional* Limit the tree depth to the specified integer value.
Defaults to ``-1`` or unlimited depth.
.. mc-cmd:: files, f
:option:
*Optional* Includes files in the object or directory in the :mc:`mc tree`
output.
.. mc-cmd:: rewind
:option:
.. include:: /includes/facts-versioning.rst
:start-after: start-rewind-desc
:end-before: end-rewind-desc
Examples
--------
.. code-block:: shell
:class: copyable
mc tree ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc tree ALIAS>` with the :ref:`alias <alias>`
of the MinIO deployment.
- Replace :mc-cmd:`PATH <mc tree ALIAS>` with the path to the bucket on the
MinIO deployment.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,59 @@
=============
``mc update``
=============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
.. mc:: mc update
Syntax
------
.. start-mc-update-desc
The :mc:`mc update` command automatically updates the :program:`mc` binary to
the latest stable version.
.. end-mc-update-desc
Running this command is equivalent to manually downloading the latest
stable binary and using it to replace the existing ``mc`` installation on the
host machine.
.. tab-set::
.. tab-item:: EXAMPLE
The following command updates the :program:`mc` binary on the local host:
.. code-block:: shell
:class: copyable
mc update
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] update
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Use :mc:`mc update` after updating the :program:`minio` server binary to
ensure consistent behavior and compatibility.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-json-globals
:end-before: end-minio-mc-json-globals

View File

@ -0,0 +1,186 @@
==============
``mc version``
==============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc version
Description
-----------
.. start-mc-version-desc
The :mc:`mc version` command enables, suspends, and retrieves the
:ref:`versioning <minio-bucket-versioning>` configuration for a MinIO bucket.
.. end-mc-version-desc
.. tab-set::
.. tab-item:: EXAMPLE
The following command enables, suspends, and retrieves versioning
for the ``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc version enable myminio/mydata
mc version info myminio/mydata
mc version suspend myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] version \
[enable | suspend | info] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: enable
Enables versioning on the MinIO bucket specified to
:mc-cmd:`ALIAS <mc version ALIAS>`.
Mutually exclusive with :mc-cmd:`~mc version suspend` and
:mc-cmd:`~mc version info`
.. mc-cmd:: suspend
Disables versioning on the MinIO bucket specified to
:mc-cmd:`ALIAS <mc version ALIAS>`.
Mutually exclusive with :mc-cmd:`~mc version suspend` and
:mc-cmd:`~mc version info`
.. mc-cmd:: info
Returns the versioning configuration for the MinIO bucket specified to
:mc-cmd:`ALIAS <mc version ALIAS>`.
Mutually exclusive with :mc-cmd:`~mc version suspend` and
:mc-cmd:`~mc version info`
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO deployment and the full path
to the bucket for which to set the versioning configuration. For example:
.. code-block:: shell
mc version enable myminio/mybucket
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-json-globals
:end-before: end-minio-mc-json-globals
Examples
--------
Enable Bucket Versioning
~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc version suspend` to enable versioning on a bucket:
.. code-block:: shell
:class: copyable
mc version ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc version ALIAS>` with the
:mc:`alias <mc alias>` of a configured MinIO deployment.
- Replace :mc-cmd:`PATH <mc version ALIAS>` with the bucket on which
to enable versioning.
Disable Bucket Versioning
~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc version suspend` to suspend versioning on a bucket:
.. code-block:: shell
:class: copyable
mc version ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc version ALIAS>` with the
:mc:`alias <mc alias>` of a configured MinIO deployment.
- Replace :mc-cmd:`PATH <mc version ALIAS>` with the bucket on which
to suspend versioning.
Get Bucket Versioning Status
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use :mc-cmd:`mc version info` to enable versioning on a bucket:
.. code-block:: shell
:class: copyable
mc version ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc version ALIAS>` with the
:mc:`alias <mc alias>` of a configured MinIO deployment.
- Replace :mc-cmd:`PATH <mc version ALIAS>` with the bucket on which
to retrieve the versioning status.
Behavior
--------
Object Locking Enables Bucket Versioning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While bucket versioning is disabled by default, configuring
object locking on a bucket or an object in that bucket automatically
enables versioning for the bucket. See
:mc:`mc retention` for more information on configuring object locking.
Bucket Versioning Requires Distributed MinIO
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MinIO bucket versioning is available only on
:ref:`distributed MinIO deployments <deploy-minio-distributed>`. Specifically,
Bucket versioning requires that the MinIO deployment supports
:ref:`erasure coding <minio-erasure-coding>` (4+ drives). Standalone
MinIO deployments (1 drive) cannot support bucket versioning.
See the linked :ref:`comparison table <minio-installation-comparison>` for
a complete list of features available only with distributed MinIO deployments.
Bucket Versioning with Existing Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enabling bucket versioning on a bucket with existing data immediately applies
a versioning ID to any unversioned object.
Disabling bucket versioning on a bucket with existing versioned data does
*not* remove any versioned objects. Applications can continue to access
versioned data after disabling bucket versioning. Use
:mc-cmd:`mc rm --versions ALIAS/BUCKET/OBJECT <mc rm versions>` to delete an
object *and* all its versions.
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility

View File

@ -0,0 +1,138 @@
============
``mc watch``
============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. mc:: mc watch
Syntax
------
.. start-mc-watch-desc
The :mc:`mc watch` command watches for events on the specified MinIO bucket or
local filesystem path. For S3 services, use :mc:`mc event add` to configure
bucket event notifications on S3-compatible services.
.. end-mc-watch-desc
You can also use :mc:`mc watch` against a local filesystem directory to
produce similar results to running
the ``inotify -e modify,create,delete,move`` command.
.. tab-set::
.. tab-item:: EXAMPLE
The following command watches for
:ref:`events <mc-event-supported-events>` on any object or prefix in the
``mydata`` bucket on the ``myminio`` MinIO deployment:
.. code-block:: shell
:class: copyable
mc watch --recursive myminio/mydata
.. tab-item:: SYNTAX
The command has the following syntax:
.. code-block:: shell
:class: copyable
mc [GLOBALFLAGS] watch \
[--event "string"] \
[--prefix "string"] \
[--recursive] \
[--suffix "string"] \
ALIAS
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax
:end-before: end-minio-syntax
Parameters
~~~~~~~~~~
.. mc-cmd:: ALIAS
*Required* The :ref:`alias <alias>` of a MinIO deployment and the
full path to the bucket to watch for configured events. For example:
.. code-block:: shell
mc tree myminio/mybucket
.. mc-cmd:: event
:option:
The event(s) to watch for. Specify multiple events using a comma ``,``
delimiter. See :ref:`mc-event-supported-events` for supported events.
Defaults to ``put,delete, get``.
.. mc-cmd:: prefix
:option:
The bucket prefix in which to watch for the specified
:mc-cmd-option:`~mc watch event`.
For example, given a :mc-cmd:`~mc watch ALIAS` of ``play/mybucket`` and a
:mc-cmd-option:`~mc watch prefix` of ``photos``, only events in
``play/mybucket/photos`` trigger bucket notifications.
.. mc-cmd:: recursive, r
:option:
Recursively watch for events in the specified
:mc-cmd:`~mc watch ALIAS` bucket path or local directory.
.. mc-cmd:: suffix
:option:
The bucket suffix in which to watch for the specified
:mc-cmd-option:`~mc watch event`.
For example, given a :mc-cmd:`~mc watch ALIAS` of ``play/mybucket`` and a
:mc-cmd-option:`~mc watch suffix` of ``.jpg``, only events in
``play/mybucket/*.jpg`` trigger bucket notifications.
Global Flags
~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-json-globals
:end-before: end-minio-mc-json-globals
Examples
--------
Watch for Events in a Bucket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: shell
:class: copyable
mc watch --recursive ALIAS/PATH
- Replace :mc-cmd:`ALIAS <mc watch ALIAS>` with the :mc:`alias <mc alias>`
of the S3-compatible host.
- Replace :mc-cmd:`PATH <mc watch ALIAS>` with the path to the bucket.
Behavior
--------
S3 Compatibility
~~~~~~~~~~~~~~~~
.. include:: /includes/common-minio-mc.rst
:start-after: start-minio-mc-s3-compatibility
:end-before: end-minio-mc-s3-compatibility