1
0
mirror of https://github.com/minio/docs.git synced 2025-08-06 14:42:56 +03:00

Add --action for mc undo (#1133)

Document new option for `mc undo` to restrict the command to reverse
either `DELETE` or `PUT` operations, not both.

Staged

http://192.241.195.202:9000/staging/DOCS-1113/linux/reference/minio-mc/mc-undo.html

Fixes https://github.com/minio/docs/issues/1113
This commit is contained in:
Andrea Longo
2024-03-22 10:15:22 -06:00
committed by GitHub
parent 6cae178c36
commit 3c2258375b

View File

@@ -25,7 +25,7 @@ The :mc:`mc undo` command reverses changes due to either a ``PUT`` or ``DELETE``
.. tab-item:: EXAMPLE .. tab-item:: EXAMPLE
The following command undoes the last three uploads and/or removals of the ``file.zip`` object on the ``myminio`` deployment in the ``data`` bucket: The following command reverts the last three uploads and/or deletions of the ``file.zip`` object on the ``myminio`` deployment in the ``data`` bucket:
.. code-block:: shell .. code-block:: shell
:class: copyable :class: copyable
@@ -39,17 +39,19 @@ The :mc:`mc undo` command reverses changes due to either a ``PUT`` or ``DELETE``
.. code-block:: shell .. code-block:: shell
:class: copyable :class: copyable
mc [GLOBALFLAGS] undo \ mc [GLOBALFLAGS] undo \
TARGET \ TARGET \
[--last "integer"] \ [--action "type"] \
[--recursive, r] \ [--force] \
[--force] \ [--last "integer"] \
[--recursive, r] \
[--dry-run] [--dry-run]
.. include:: /includes/common-minio-mc.rst .. include:: /includes/common-minio-mc.rst
:start-after: start-minio-syntax :start-after: start-minio-syntax
:end-before: end-minio-syntax :end-before: end-minio-syntax
Parameters Parameters
~~~~~~~~~~ ~~~~~~~~~~
@@ -59,23 +61,30 @@ Parameters
The full path to the object or prefix where the command should run. The full path to the object or prefix where the command should run.
The path must include the :ref:`ALIAS <minio-mc-alias>`, bucket, and prefix or object name. The path must include the :ref:`ALIAS <minio-mc-alias>`, bucket, and prefix or object name.
.. mc-cmd:: --last .. mc-cmd:: --action
:optional: :optional:
Accepts an integer value specifying the number of ``PUT`` and/or ``DELETE`` changes to undo. Undo the most recent change of the specified type.
Accepted values are ``DELETE`` or ``PUT``.
If not specified, the command undoes one (``1``) operation.
.. mc-cmd:: --recursive, r By default, :mc:`mc undo` reverses both ``DELETE`` and ``PUT`` operations.
:optional: Use :mc-cmd:`~mc undo --action` to choose one or the other, but only for the most recent operation of the specified type.
Performs the command in a recursive fashion. The following command reverts the most recent ``PUT`` for the object ``today.zip`` in bucket ``data``, reverting to the previous object version:
Use this flag to undo changes on a prefix, for example.
.. mc-cmd:: --force .. code-block:: shell
:optional: :class: copyable
Force a recursive operation. mc undo myminio/data/today.zip --action "PUT"
This example reverts the most recent ``DELETE`` for the prefix ``archive``, recursively restoring it and any child objects:
.. code-block:: shell
:class: copyable
mc undo myminio/data/archive --recursive --action "DELETE"
Mutually exclusive with :mc-cmd:`~mc undo --last`.
.. mc-cmd:: --dry-run .. mc-cmd:: --dry-run
:optional: :optional:
@@ -83,6 +92,25 @@ Parameters
Output the results of the command without actually performing the operations. Output the results of the command without actually performing the operations.
Use this flag to test the outcome of running the command in a particular way. Use this flag to test the outcome of running the command in a particular way.
.. mc-cmd:: --force
:optional:
Force a recursive operation.
.. mc-cmd:: --last
:optional:
Accepts an integer value specifying the number of ``PUT`` and/or ``DELETE`` changes to undo.
If not specified, the command reverses one (``1``) operation.
Mutually exclusive with :mc-cmd:`~mc undo --action`.
.. mc-cmd:: --recursive, r
:optional:
Performs the command in a recursive fashion.
Use this flag to undo changes on a prefix, for example.
Global Flags Global Flags
~~~~~~~~~~~~ ~~~~~~~~~~~~
@@ -97,7 +125,7 @@ Examples
Undo the Last Three Uploads or Deletions on an Object Undo the Last Three Uploads or Deletions on an Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following command undoes the last three uploads and/or removals of the ``file.zip`` object on the ``myminio`` deployment in the ``data`` bucket: The following command reverts the last three uploads and/or deletions of the ``file.zip`` object on the ``myminio`` deployment in the ``data`` bucket:
.. code-block:: shell .. code-block:: shell
:class: copyable :class: copyable