forget: Add --keep-within-hourly (and friends)

Allow keeping hourly/daily/weekly/monthly/yearly snapshots for a given time period.

This adds the following flags/parameters to restic forget:
  --keep-within-hourly duration
  --keep-within-daily duration
  --keep-within-weekly duration
  --keep-within-monthly duration
  --keep-within-yearly duration

Includes following changes:
  - Add tests for --keep-within-hourly (and friends)
  - Add documentation for --keep-within-hourly (and friends)
  - Add changelog for --keep-within-hourly (and friends)
This commit is contained in:
Magnus Thor Torfason
2021-07-24 16:14:43 +00:00
parent c707d71b72
commit 74ebc650ab
11 changed files with 2580 additions and 25 deletions
+77 -9
View File
@@ -12,18 +12,25 @@ import (
// ExpirePolicy configures which snapshots should be automatically removed.
type ExpirePolicy struct {
Last int // keep the last n snapshots
Hourly int // keep the last n hourly snapshots
Daily int // keep the last n daily snapshots
Weekly int // keep the last n weekly snapshots
Monthly int // keep the last n monthly snapshots
Yearly int // keep the last n yearly snapshots
Within Duration // keep snapshots made within this duration
Tags []TagList // keep all snapshots that include at least one of the tag lists.
Last int // keep the last n snapshots
Hourly int // keep the last n hourly snapshots
Daily int // keep the last n daily snapshots
Weekly int // keep the last n weekly snapshots
Monthly int // keep the last n monthly snapshots
Yearly int // keep the last n yearly snapshots
Within Duration // keep snapshots made within this duration
WithinHourly Duration // keep hourly snapshots made within this duration
WithinDaily Duration // keep daily snapshots made within this duration
WithinWeekly Duration // keep weekly snapshots made within this duration
WithinMonthly Duration // keep monthly snapshots made within this duration
WithinYearly Duration // keep yearly snapshots made within this duration
Tags []TagList // keep all snapshots that include at least one of the tag lists.
}
func (e ExpirePolicy) String() (s string) {
var keeps []string
var keepw []string
if e.Last > 0 {
keeps = append(keeps, fmt.Sprintf("%d latest", e.Last))
}
@@ -43,8 +50,35 @@ func (e ExpirePolicy) String() (s string) {
keeps = append(keeps, fmt.Sprintf("%d yearly", e.Yearly))
}
if !e.WithinHourly.Zero() {
keepw = append(keepw, fmt.Sprintf("hourly snapshots within %v", e.WithinHourly))
}
if !e.WithinDaily.Zero() {
keepw = append(keepw, fmt.Sprintf("daily snapshots within %v", e.WithinDaily))
}
if !e.WithinWeekly.Zero() {
keepw = append(keepw, fmt.Sprintf("weekly snapshots within %v", e.WithinWeekly))
}
if !e.WithinMonthly.Zero() {
keepw = append(keepw, fmt.Sprintf("monthly snapshots within %v", e.WithinMonthly))
}
if !e.WithinYearly.Zero() {
keepw = append(keepw, fmt.Sprintf("yearly snapshots within %v", e.WithinYearly))
}
if len(keeps) > 0 {
s = fmt.Sprintf("keep %s snapshots", strings.Join(keeps, ", "))
s = fmt.Sprintf("%s snapshots", strings.Join(keeps, ", "))
}
if len(keepw) > 0 {
if s != "" {
s += ", "
}
s += strings.Join(keepw, ", ")
}
if len(e.Tags) > 0 {
@@ -61,6 +95,8 @@ func (e ExpirePolicy) String() (s string) {
s += fmt.Sprintf("all snapshots within %s of the newest", e.Within)
}
s = "keep " + s
return s
}
@@ -166,6 +202,7 @@ func ApplyPolicy(list Snapshots, p ExpirePolicy) (keep, remove Snapshots, reason
return list, nil, nil
}
// These buckets are for keeping last n snapshots of given type
var buckets = [6]struct {
Count int
bucker func(d time.Time, nr int) int
@@ -180,6 +217,20 @@ func ApplyPolicy(list Snapshots, p ExpirePolicy) (keep, remove Snapshots, reason
{p.Yearly, y, -1, "yearly snapshot"},
}
// These buckets are for keeping snapshots of given type within duration
var bucketsWithin = [5]struct {
Within Duration
bucker func(d time.Time, nr int) int
Last int
reason string
}{
{p.WithinHourly, ymdh, -1, "hourly within"},
{p.WithinDaily, ymd, -1, "daily within"},
{p.WithinWeekly, yw, -1, "weekly within"},
{p.WithinMonthly, ym, -1, "monthly within"},
{p.WithinYearly, y, -1, "yearly within"},
}
latest := findLatestTimestamp(list)
for nr, cur := range list {
@@ -217,6 +268,23 @@ func ApplyPolicy(list Snapshots, p ExpirePolicy) (keep, remove Snapshots, reason
}
}
// If the timestamp is within range, and the snapshot is an hourly/daily/weekly/monthly/yearly snapshot, then keep it
for i, b := range bucketsWithin {
if !b.Within.Zero() {
t := latest.AddDate(-b.Within.Years, -b.Within.Months, -b.Within.Days).Add(time.Hour * time.Duration(-b.Within.Hours))
if cur.Time.After(t) {
val := b.bucker(cur.Time, nr)
if val != b.Last {
debug.Log("keep %v, time %v, ID %v, bucker %v, val %v %v\n", b.reason, cur.Time, cur.id.Str(), i, val, b.Last)
keepSnap = true
bucketsWithin[i].Last = val
keepSnapReasons = append(keepSnapReasons, fmt.Sprintf("%v %v", b.reason, b.Within))
}
}
}
}
if keepSnap {
keep = append(keep, cur)
kr := KeepReason{
+11
View File
@@ -228,6 +228,17 @@ func TestApplyPolicy(t *testing.T) {
{Within: parseDuration("13d23h")},
{Within: parseDuration("2m2h")},
{Within: parseDuration("1y2m3d3h")},
{WithinHourly: parseDuration("1y2m3d3h")},
{WithinDaily: parseDuration("1y2m3d3h")},
{WithinWeekly: parseDuration("1y2m3d3h")},
{WithinMonthly: parseDuration("1y2m3d3h")},
{WithinYearly: parseDuration("1y2m3d3h")},
{Within: parseDuration("1h"),
WithinHourly: parseDuration("1d"),
WithinDaily: parseDuration("7d"),
WithinWeekly: parseDuration("1m"),
WithinMonthly: parseDuration("1y"),
WithinYearly: parseDuration("9999y")},
}
for i, p := range tests {
+926
View File
@@ -0,0 +1,926 @@
{
"keep": [
{
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-12T21:08:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-09T21:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-08T20:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-07T10:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-06T08:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-05T09:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-04T16:23:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-04T12:30:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-04T11:23:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-04T10:23:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-03T07:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-01T07:08:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-01T01:03:03Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-21T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-18T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-15T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-13T10:20:30.1Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-12T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-10T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-11T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-10T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-09T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-06T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-05T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-02T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-01T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-11T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-10T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-09T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-06T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-05T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-02T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-01T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-21T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-18T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-15T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-13T10:20:30.1Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-12T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-10T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-21T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-18T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-15T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
}
],
"reasons": [
{
"snapshot": {
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-12T21:08:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-09T21:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-08T20:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-07T10:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-06T08:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-05T09:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-04T16:23:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-04T12:30:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-04T11:23:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-04T10:23:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-03T07:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-01T07:08:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-01T01:03:03Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-21T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-18T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-15T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-13T10:20:30.1Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-12T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-10T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-11T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-10T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-09T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-06T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-05T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-02T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-01T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-11T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-10T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-09T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-06T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-05T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-02T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-01T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-21T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-18T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-15T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-13T10:20:30.1Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-12T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-10T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-21T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-18T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-15T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"hourly within 1y2m3d3h"
],
"counters": {}
}
]
}
+862
View File
@@ -0,0 +1,862 @@
{
"keep": [
{
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-12T21:08:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-09T21:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-08T20:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-07T10:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-06T08:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-05T09:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-04T16:23:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-03T07:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-01T07:08:03Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-21T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-18T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-15T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-13T10:20:30.1Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-12T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-10T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-11T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-10T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-09T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-06T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-05T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-02T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-01T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-11T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-10T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-09T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-06T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-05T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-02T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-01T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-21T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-18T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-15T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-13T10:20:30.1Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-12T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-10T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-21T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-18T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-15T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
}
],
"reasons": [
{
"snapshot": {
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-12T21:08:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-09T21:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-08T20:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-07T10:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-06T08:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-05T09:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-04T16:23:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-03T07:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-01T07:08:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-21T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-18T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-15T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-13T10:20:30.1Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-12T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-10T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-11T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-10T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-09T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-06T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-05T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-02T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-01T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-11T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-10T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-09T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-06T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-05T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-02T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-01T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-21T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-18T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-15T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-13T10:20:30.1Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-12T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-10T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-21T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-18T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-15T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"daily within 1y2m3d3h"
],
"counters": {}
}
]
}
+318
View File
@@ -0,0 +1,318 @@
{
"keep": [
{
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-12T21:08:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-09T21:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-03T07:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-15T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-11T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-02T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-20T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-11T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-06T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-15T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-08T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-15T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
}
],
"reasons": [
{
"snapshot": {
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-12T21:08:03Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-09T21:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-03T07:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-15T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-11T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-02T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-20T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-11T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-06T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-15T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-08T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-15T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"weekly within 1y2m3d3h"
],
"counters": {}
}
]
}
+102
View File
@@ -0,0 +1,102 @@
{
"keep": [
{
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
}
],
"reasons": [
{
"snapshot": {
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y2m3d3h"
],
"counters": {}
}
]
}
+54
View File
@@ -0,0 +1,54 @@
{
"keep": [
{
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
}
],
"reasons": [
{
"snapshot": {
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"yearly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"yearly within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"yearly within 1y2m3d3h"
],
"counters": {}
}
]
}
+157
View File
@@ -0,0 +1,157 @@
{
"keep": [
{
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-12T21:08:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-09T21:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2016-01-03T07:02:03Z",
"tree": null,
"paths": null
},
{
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
{
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
}
],
"reasons": [
{
"snapshot": {
"time": "2016-01-18T12:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"within 1h",
"hourly within 1d",
"daily within 7d",
"weekly within 1m",
"monthly within 1y",
"yearly within 9999y"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-12T21:08:03Z",
"tree": null,
"paths": null
},
"matches": [
"daily within 7d",
"weekly within 1m"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-09T21:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1m"
],
"counters": {}
},
{
"snapshot": {
"time": "2016-01-03T07:02:03Z",
"tree": null,
"paths": null
},
"matches": [
"weekly within 1m"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y",
"yearly within 9999y"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-09-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-08-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"monthly within 1y"
],
"counters": {}
},
{
"snapshot": {
"time": "2014-11-22T10:20:30Z",
"tree": null,
"paths": null
},
"matches": [
"yearly within 9999y"
],
"counters": {}
}
]
}