Skip to main content
All CollectionsActions
The Grandfather-Father-Son Algorithm
The Grandfather-Father-Son Algorithm
Matt Houser avatar
Written by Matt Houser
Updated over 7 years ago

Introduction

Skeddly includes a delete scheme called "Grandfather-Father-Son" that can be used to preserve snapshots and images in many configurations. For example, you can choose to keep:

  • 7 daily snapshots, and

  • 5 weekly snapshots, and

  • 12 monthly snapshots, and

  • 5 yearly snapshots

Simply create the snapshots and/or images regularly on a daily basis. Skeddly will use the creation dates on the snapshots/images to determine which items will be preserved.

Time Periods

Skeddly uses the following time periods when the Grandfather-Father-Son algorithm is being used:

  • Day: From 12:00am to 11:59pm

  • Week: From 12:00am Sunday to 11:59pm Saturday

  • Month: From 12:00am on day 1 of a calendar month to 11:59pm on the last day of the same calendar month

  • Year: From 12:00am on January 1 to 11:59pm on December 31 of the same calendar year

Note that all times are in UTC

What Is Preserved?

For each time range defined, the most recent item in the time range is preserved first.

Example 1: Day
​

The last snapshot of the day is preserved first. If your action is configured to preserve 2 or more daily snapshots, then the second-to-last snapshot would be preserved next.

Example 2: Week

The last snapshot on Saturday is preserved first. If there is no snapshot on Saturday, then Friday's snapshot would be preserved. If that does not exist, then Thursday's snapshot would be preserved. And so on until a snapshot is preserved for that week.

Example 3: Month

The last snapshot of on the 31st day of the month will be preserve first. If that does not exist, then the last snapshot on the 30th day of the month will be preserved. And so on until a snapshot is preserved for that month.

Configuration

As part of configuring the Grandfather-Father-Son algorithm, for each of day, week, month and year, you specify 2 parts:

  • The number of snapshots/images to preserve for each time period, and

  • The number of time periods to preserve

Normally, 1 snapshot/image would be preserved for each day, but you can choose to preserve more.
​
​Example 1: Day

You can choose to preserve "1 daily snapshot" and "For 7 days".

In this case, you will preserve the single latest snapshot from each day, for each of the last 7 days.

If you had chosen "2 daily snapshots", then 2 snapshots would be preserved for each of the last 7 days.

Example 2: Week

You can choose to preserve "1 weekly snapshots" and "For 5 weeks".

In this case, you will preserve the last snapshot of each Saturday, for the previous 5 weeks.

Additional Notes

All time comparisons are done using UTC.
​
Skeddly does not support alternate time periods.

It is not possible to configure the day of the week to preserve for weekly snapshots.

It is not possible to preserve the snapshots from the first of the month instead of the last.

Did this answer your question?