Associated Doc

Can I Archive Only Specific Objects Based on Size or Prefix/Folder?

Updated on 01 April, 2026

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 folder
  • ObjectSizeGreaterThan — targets objects larger than a specified size in bytes
  • ObjectSizeLessThan — targets objects smaller than a specified size in bytes

Multiple filter elements can be combined using an And wrapper.

Archive by Prefix

The following policy transitions all objects under the to_archive prefix to Archival immediately:

xml
<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>

Archive by Size

The following policy transitions all objects larger than 1 GB to Archival immediately:

xml
<LifecycleConfiguration>
  <Rule>
    <ID>Move1GToArchive</ID>
    <Filter>
      <ObjectSizeGreaterThan>1000000000</ObjectSizeGreaterThan>
    </Filter>
    <Status>Enabled</Status>
    <Transition>
      <Days>0</Days>
      <StorageClass>VULTR_ARCHIVE</StorageClass>
    </Transition>
  </Rule>
</LifecycleConfiguration>

Archive by Size and Prefix Combined

The following policy transitions all objects larger than 1 GB under the to_archive prefix to Archival after 4 days:

xml
<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>

Apply the Policy via CLI Tools

Once you have defined your lifecycle policy in a file, apply it to your bucket using either s3cmd or the AWS CLI.

  • s3cmd

    console
    $ s3cmd -c S3_CONFIG setlifecycle lifecycle.xml s3://BUCKET_NAME/
    
  • AWS CLI

    console
    $ 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.