Running a recursive mc undo
with time limitations?
#19580
-
Hello, I ran a I would like to undo any DELETE actions which happened between two points of time. Is there any way to accomplish this, or will I have to write a script? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The Go api for Minio supports custom SELECT expressions for restore operations (https://github.com/minio/minio-go/blob/v7.0.69/api-restore.go#L85). One may be able to write an expression to select files that were deleted during this custom time frame. Let me tinker a bit, and see what is currently supported. I'll get back to you. |
Beta Was this translation helpful? Give feedback.
-
Hey @jaw-sh. I was able to un-delete versioned objects in my Minio installation with a single bash command. In short, the best tool to use for this job is the AWS cli- minio's CLI doesn't provide the functionality that is needed. Using the object versioning commands provided by the here's the monster of a command that you can use here:
I'll explain. list the version metadata
query for deletion markers between a certain date
remove the deletion marker from minio
Some warningsThe Make sure to run the first the xargs command will take a while. you may want to test with parallel workers. I highly recommend you try a dry run, as the version of minio I have deployed may have features that your deployment does not. |
Beta Was this translation helpful? Give feedback.
Hey @jaw-sh. I was able to un-delete versioned objects in my Minio installation with a single bash command. In short, the best tool to use for this job is the AWS cli- minio's CLI doesn't provide the functionality that is needed.
Using the object versioning commands provided by the
list-object-versions
command, we can delete the 'delete marker' on all of the objects.I used these docs as a reference: https://repost.aws/knowledge-center/s3-undelete-configuration, specifically from the
Remove the delete marker on thousands of objects
section.here's the monster of a command that you can use here: