mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Add MaxNoncurrentVersions to NoncurrentExpiration action (#13580)
This unit allows users to limit the maximum number of noncurrent
versions of an object.
To enable this rule you need the following *ilm.json*
```
cat >> ilm.json <<EOF
{
"Rules": [
{
"ID": "test-max-noncurrent",
"Status": "Enabled",
"Filter": {
"Prefix": "user-uploads/"
},
"NoncurrentVersionExpiration": {
"MaxNoncurrentVersions": 5
}
}
]
}
EOF
mc ilm import myminio/mybucket < ilm.json
```
This commit is contained in:
committed by
GitHub
parent
1e2fac054c
commit
3da9ee15d3
@@ -81,7 +81,29 @@ e.g., To scan objects stored under `user-uploads/` prefix and remove versions ol
|
||||
}
|
||||
```
|
||||
|
||||
### 3.2 Automatic removal of delete markers with no other versions
|
||||
|
||||
### 3.2 Automatic removal of noncurrent versions older than most recent
|
||||
|
||||
It is possible to configure automatic removal of noncurrent versions older than the most recent `N` using MinIO specific lifecycle policy extension `MaxNoncurrentVersions`.
|
||||
|
||||
e.g, To remove noncurrent versions of all objects older than most recent 5 noncurrent versions under the prefix `user-uploads/`,
|
||||
```
|
||||
{
|
||||
"Rules": [
|
||||
{
|
||||
"ID": "Remove noncurrent versions older than",
|
||||
"Status": "Enabled",
|
||||
"Filter": {
|
||||
"Prefix": "users-uploads/"
|
||||
},
|
||||
"NoncurrentVersionExpiration": {
|
||||
"MaxNoncurrentVersions": 5
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
### 3.3 Automatic removal of delete markers with no other versions
|
||||
|
||||
When an object has only one version as a delete marker, the latter can be automatically removed after a certain number of days using the following configuration:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user