Archive specific objects using lifecycle policies based on size, prefix, or combined filtering rules.
Yes. You can customize the lifecycle policy on a Vultr Standard Object Storage bucket to selectively archive objects based on size, prefix, or a combination of both. Objects that do not match the lifecycle policy filters remain in your bucket and are not transitioned to Archival, meaning a single bucket can have objects in both Standard and Archival storage at the same time.
Note that on a standalone Archival Object Storage subscription, the lifecycle policy is fixed and cannot be permanently customized. All objects are transitioned to Archival by default.
The VULTR_ARCHIVE storage class supports the following filter elements:
Prefix — targets objects under a specific path or folderObjectSizeGreaterThan — targets objects larger than a specified size in bytesObjectSizeLessThan — targets objects smaller than a specified size in bytesMultiple filter elements can be combined using an And wrapper.
The following policy transitions all objects under the to_archive prefix to Archival immediately:
<LifecycleConfiguration>
<Rule>
<ID>MoveObjectsToArchive</ID>
<Filter>
<Prefix>to_archive</Prefix>
</Filter>
<Status>Enabled</Status>
<Transition>
<Days>0</Days>
<StorageClass>VULTR_ARCHIVE</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>
The following policy transitions all objects larger than 1 GB to Archival immediately:
<LifecycleConfiguration>
<Rule>
<ID>Move1GToArchive</ID>
<Filter>
<ObjectSizeGreaterThan>1000000000</ObjectSizeGreaterThan>
</Filter>
<Status>Enabled</Status>
<Transition>
<Days>0</Days>
<StorageClass>VULTR_ARCHIVE</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>
The following policy transitions all objects larger than 1 GB under the to_archive prefix to Archival after 4 days:
<LifecycleConfiguration>
<Rule>
<ID>Move1GToArchive</ID>
<Filter>
<And>
<ObjectSizeGreaterThan>1000000000</ObjectSizeGreaterThan>
<Prefix>to_archive</Prefix>
</And>
</Filter>
<Status>Enabled</Status>
<Transition>
<Days>4</Days>
<StorageClass>VULTR_ARCHIVE</StorageClass>
</Transition>
</Rule>
</LifecycleConfiguration>
Once you have defined your lifecycle policy in a file, apply it to your bucket using either s3cmd or the AWS CLI.
s3cmd
$ s3cmd -c S3_CONFIG setlifecycle lifecycle.xml s3://BUCKET_NAME/
AWS CLI
$ aws s3api put-bucket-lifecycle --bucket BUCKET_NAME --lifecycle-configuration file://lifecycle.xml
To further learn how to retrieve the current lifecycle policy and apply an updated version using the Vultr Console or API, refer to our product documentation.