Staggered snapshots

What is the recommended way to generate staggered snapshots? For example hourly that last for a couple days, daily that last a couple weeks, weekly that last a couple months, etc.

If you just create multiple separate schedules, is there a downside to having multiple snapshots taken simultaneously? So if the year starts with a sunday, I’ll have hourly, daily, weekly, monthly and yearly snapshots all taken at the same time at 0:00 on january 1st.

I tried to create a hourly schedule only from 1 to 23 (skip 0), and daily that skips the sunday, but then it fails because the weekly schedule doesn’t exactly fit in the monthly schedule.

ZFS snapshots are very efficient… so it should work fine.
Staggering then by 5 or 10 minutes each 12.00, 12.05, 12.10 etc would also work.

I try and avoid overlapping the timestamps if I can. here’s an example - one of our production systems has a schedule like this (datasets with SMB shares)

Hourly - Every hour from 1:00 to 23:00 - Lifetime 1 week
Daily - Every Night at 00:00 (excluding 1st day of each month) - Life of 4-12 weeks
Monthly - First of every month at 00:00 - Life of 6-12months

There for a really critical smb share (lots of activity and rollback of an hour could cost $$) - the dataset has:
Every 10mins (excluding on the hours - btw 6am and 10pm) - Life of 1 Day
Followed by the rest

The main reason we avoid doing all day for our 10min one - is it just limits the amount of snapshots in “Previous Versions” as we had performance issues at different times. On our 20/30min ver - we tend to use the whole day.

Edit: You could also limit your under hourly to biz days - such as monday to friday.

I’m not sure if there is an established recommendation.

BUT I’m trialing using minutely, hourly, daily, weekly, monthly.

The key is to have each snapshot task use a different naming scheme, ie auto-hourly, auto-daily etc

Each is a separate snapshot task. With progressively longer retention.

Minutely is actually 10 minutes and retained for 2 hours.

Hourly is retained for 2 days (or whatever I forget)

Etc.

I Replicate based on the hourlies or dailies, and use the “additional schemas” to pick up everything except the minutelies.

Replication snaps should have “allow empty” enabled. I disable empty on the minutely.

Turn on the replication task allow it to control life time on destination and hold pending snaps.

On the destination I run a separate snapshot task with 10 year retention and a different naming scheme.

Use different names for each snapshot task, such as:

  • auto-weekly_XXXXXX
  • auto-daily_XXXXXX
  • auto-monthly_XXXXXX

Also good practice to append the expiration lifetime at the end, such as:

  • auto-weekly_XXXXXX-6m
  • auto-daily_XXXXXX-1w
  • auto-monthly_XXXXXX-2y

This isn’t simply for better organizing, filtering, and searching.

:warning: It will prevent you from inadvertently destroying your snapshots, without even realizing it!

2 Likes