IN THIS ARTICLE
Outlines how to set an expiration at a specified time to automatically delete a snapshot
REQUIREMENTS
- Qumulo Core 2.5.1 or above
- Command line (CLI) tools installed via API & Tools tab
NOTE: Qumulo Core version 2.6.6 added UI support for deleting snapshots. See Snapshots: Per-Directory Snapshots for reference.
DETAILS
When you create a snapshot via the qq CLI, you can specify either the time to live or the time (in UTC) at which to delete the snapshot.
Here’s an example of creating a snapshot that expires on January 31, 2017 at midnight UTC:
qq snapshot_create_snapshot --expiration 2019-12-31T00:00:00Z
- The output of the command will result in:
{
"created_by_policy": false,
"directory_name": "1_OnDemand",
"expiration": "2019-12-31T00:00:00Z",
"id": 1,
"in_delete": false,
"name": "",
"source_file_id": "2",
"timestamp": "2019-10-30T15:44:03.206581208Z"
}
Below is an example of creating a snapshot that expires in one year:
qq snapshot_create_snapshot --time-to-live 12months
- The output will include a timestamp correlating to the specified time to live:
{
"created_by_policy": false,
"directory_name": "2_OnDemand",
"expiration": "2020-10-30T15:45:55.03510729Z",
"id": 2,
"in_delete": false,
"name": "",
"source_file_id": "2",
"timestamp": "2019-10-30T15:45:55.035125376Z"
}
NOTE: All times are expressed in UTC.
If you don’t specify an expiration time or time to live, the snapshot will never be automatically deleted.
To change or remove the expiration on existing snapshots, you can use the snapshot ID from the UI. Note that the snapshot ID is the five digit number that is featured at the beginning of the path string (ex. 63040_test homedir_test).
Use the specific Snapshot ID with the command:
qq snapshot_modify_snapshot
For example, to set the snapshot to never expire you would use the following command:
qq snapshot_modify_snapshot -i SNAPSHOT_ID -e ''
To have the snapshot expire in a specific amount of time in the future (1 hour, 1 month, 1 year, etc), you can use the following command:
qq snapshot_modify_snapshot -i SNAPSHOT_ID -t [months,weeks,days,hours,minutes]
RESOLUTION
You should now be able to successfully set the expiration on a snapshot using QQ CLI
ADDITIONAL RESOURCES
Like what you see? Share this article with your network!
Comments
0 comments
Please sign in to leave a comment.