IN THIS ARTICLE
Outlines how to automatically take snapshots on a schedule using the QQ CLI
REQUIREMENTS
- Qumulo Core 2.5.2 and above
- Command line (CLI) tools installed via API & Tools tab
NOTE: Qumulo Core version 2.6.6 added UI support for creating, editing and deleting Snapshots. See Snapshots: Per-Directory Snapshots for reference.
DETAILS
Below is a list of commands that are available to create and manage snapshot policies:
- Create a new snapshot scheduling policy
qq snapshot_create_policy
- Delete a single scheduling policy
qq snapshot_delete_policy
- List a single policy
qq snapshot_get_policy
- List all policies
qq snapshot_list_policies
- Modify an existing snapshot scheduling policy
qq snapshot_modify_policy
Each policy can specify the interval to take the snapshot (hourly_or_less, daily, or monthly) and the expiration rule. As an example, let’s create a new policy called “every_day" that takes a daily snapshot at midnight Pacific and keeps it for 7 days:
qq snapshot_create_policy daily --name every_day --time-to-live 7days --timezone America/Los_Angeles --days-of-week all --at 00:00
The command above will result in the following output:
{
"id": 1,
"name": "daily_1",
"schedules": [
{
"creation_schedule": {
"frequency": "SCHEDULE_DAILY_OR_WEEKLY",
"hour": 0,
"minute": 0,
"on_days": [
"SUN",
"MON",
"TUE",
"WED",
"THU",
"FRI",
"SAT"
],
"timezone": "America/Los_Angeles"
},
"expiration_time_to_live": "7days",
"id": 1
}
],
"source_file_ids": [
"2"
]
}
Note that the time zone field uses a location description from the INIA database. If no time zone is specified, the snapshot schedule will be in UTC. Here’s some examples of valid time zones:
- America/New_York
- America/Chicago
- America/Denver
- America/Phoenix
- America/Los_Angeles
Now let’s create an hourly policy, that is only triggered during business hours (Monday-Friday, 8am-6pm Pacific) where the snapshots are kept for 2 days.
qq snapshot_create_policy hourly_or_less --name hourly --timezone America/Los_Angeles --days-of-week MON,TUE,WED,THU,FRI --start-time 08:00 --end-time 18:00 --period 1hours --time-to-live 2days
Running the above command will result in the output below:
{
"id": 5,
"name": "Hourly",
"schedules": [
{
"creation_schedule": {
"fire_every": 1,
"fire_every_interval": "FIRE_IN_HOURS",
"frequency": "SCHEDULE_HOURLY_OR_LESS",
"on_days": [
"MON",
"TUE",
"WED",
"THU",
"FRI"
],
"timezone": "America/Los_Angeles",
"window_end_hour": 18,
"window_end_minute": 0,
"window_start_hour": 8,
"window_start_minute": 0
},
"expiration_time_to_live": "2days",
"id": 1
}
],
"source_file_ids": [
"2"
]
}
RESOLUTION
You should now be able to successfully schedule snapshots using the QQ CLI
ADDITIONAL RESOURCES
Like what you see? Share this article with your network!
Comments
0 comments
Please sign in to leave a comment.