mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
fix: the versioning/object lock documentation appropriately (#9988)
- Move the bucket level features into `docs/bucket` directory - fix issue template and simplify some of them
This commit is contained in:
57
docs/bucket/lifecycle/README.md
Normal file
57
docs/bucket/lifecycle/README.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# Bucket Lifecycle Configuration Quickstart Guide [](https://slack.min.io) [](https://hub.docker.com/r/minio/minio/)
|
||||
|
||||
Enable object lifecycle configuration on buckets to setup automatic deletion of objects after a specified number of days or a specified date.
|
||||
|
||||
## 1. Prerequisites
|
||||
- Install MinIO - [MinIO Quickstart Guide](https://docs.min.io/docs/minio-quickstart-guide).
|
||||
- Install `mc` - [mc Quickstart Guide](https://docs.minio.io/docs/minio-client-quickstart-guide.html)
|
||||
|
||||
## 2. Enable bucket lifecycle configuration
|
||||
|
||||
- Create a bucket lifecycle configuration which expires the objects under the prefix `old/` on `2020-01-01T00:00:00.000Z` date and the objects under `temp/` after 7 days.
|
||||
- Enable bucket lifecycle configuration using `mc`:
|
||||
|
||||
```sh
|
||||
$ mc ilm import play/testbucket
|
||||
{
|
||||
"Rules": [
|
||||
{
|
||||
"Expiration": {
|
||||
"Date": "2020-01-01T00:00:00.000Z"
|
||||
},
|
||||
"ID": "OldPictures",
|
||||
"Filter": {
|
||||
"Prefix": "old/"
|
||||
},
|
||||
"Status": "Enabled"
|
||||
},
|
||||
{
|
||||
"Expiration": {
|
||||
"Days": 7
|
||||
},
|
||||
"ID": "TempUploads",
|
||||
"Filter": {
|
||||
"Prefix": "temp/"
|
||||
},
|
||||
"Status": "Enabled"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Lifecycle configuration imported successfully to `play/testbucket`.
|
||||
```
|
||||
|
||||
- List the current settings
|
||||
```
|
||||
$ mc ilm list play/testbucket
|
||||
ID | Prefix | Enabled | Expiry | Date/Days | Transition | Date/Days | Storage-Class | Tags
|
||||
------------|----------|------------|--------|--------------|--------------|------------------|------------------|------------------
|
||||
OldPictures | old/ | ✓ | ✓ | 1 Jan 2020 | ✗ | | |
|
||||
------------|----------|------------|--------|--------------|--------------|------------------|------------------|------------------
|
||||
TempUploads | temp/ | ✓ | ✓ | 7 day(s) | ✗ | | |
|
||||
------------|----------|------------|--------|--------------|--------------|------------------|------------------|------------------
|
||||
```
|
||||
|
||||
## Explore Further
|
||||
- [MinIO | Golang Client API Reference](https://docs.min.io/docs/golang-client-api-reference.html#SetBucketLifecycle)
|
||||
- [Object Lifecycle Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html)
|
||||
Reference in New Issue
Block a user