Range limit_daily;
Range limit_monthly;
Range limit_weekly;
+ Range limit_quarterly;
Range limit_yearly;
};
<< "limit-daily:" << parameters.limit_daily << '\n'
<< "limit-weekly:" << parameters.limit_weekly << '\n'
<< "limit-monthly:" << parameters.limit_monthly << '\n'
+ << "limit-quarterly:" << parameters.limit_quarterly << '\n'
<< "limit-yearly:" << parameters.limit_yearly;
}
TimelineParameters::TimelineParameters(const ProxySnapper* snapper)
: Parameters(snapper), limit_hourly(10), limit_daily(10), limit_monthly(10),
- limit_weekly(0), limit_yearly(10)
+ limit_weekly(0), limit_quarterly(0), limit_yearly(10)
{
ProxyConfig config = snapper->getConfig();
read(config, "TIMELINE_LIMIT_DAILY", limit_daily);
read(config, "TIMELINE_LIMIT_WEEKLY", limit_weekly);
read(config, "TIMELINE_LIMIT_MONTHLY", limit_monthly);
+ read(config, "TIMELINE_LIMIT_QUARTERLY", limit_quarterly);
read(config, "TIMELINE_LIMIT_YEARLY", limit_yearly);
#ifdef VERBOSE_LOGGING
{
return limit_hourly.is_degenerated() && limit_daily.is_degenerated() &&
limit_monthly.is_degenerated() && limit_weekly.is_degenerated() &&
- limit_yearly.is_degenerated();
+ limit_quarterly.is_degenerated() && limit_yearly.is_degenerated();
}
return is_first(first, last, it1, equal_year);
}
+ bool
+ is_first_quarterly(list<ProxySnapshots::iterator>::const_iterator first,
+ list<ProxySnapshots::iterator>::const_iterator last,
+ ProxySnapshots::const_iterator it1)
+ {
+ return is_first(first, last, it1, equal_quarter);
+ }
+
bool
is_first_monthly(list<ProxySnapshots::iterator>::const_iterator first,
list<ProxySnapshots::iterator>::const_iterator last,
size_t num_daily = 0;
size_t num_weekly = 0;
size_t num_monthly = 0;
+ size_t num_quarterly = 0;
size_t num_yearly = 0;
list<ProxySnapshots::iterator>::iterator it = ret.begin();
++num_monthly;
keep = true;
}
+ if (num_quarterly < parameters.limit_quarterly.value(value) && is_first_quarterly(it, ret.end(), *it))
+ {
+ ++num_quarterly;
+ keep = true;
+ }
if (num_yearly < parameters.limit_yearly.value(value) && is_first_yearly(it, ret.end(), *it))
{
++num_yearly;
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>TIMELINE_LIMIT_QUARTERLY=<replaceable>number</replaceable> or
+ <replaceable>range</replaceable></option></term>
+ <listitem>
+ <para>Defines how many quarterly snapshots the timeline cleanup
+ algorithm should keep. A quarterly snapshot is the first snapshot in a quarter. The
+ youngest quarterly snapshots will be kept.</para>
+ <para>Default value is "0".</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>TIMELINE_LIMIT_YEARLY=<replaceable>number</replaceable> or
<replaceable>range</replaceable></option></term>
local curcontext=${curcontext%:*:*}:snapper-$words[1]:
local algorithms=(
'number:Deletes\ old\ snapshots\ when\ a\ certain\ number\ of\ snapshots\ is\ reached'
- 'timeline:Deletes\ old\ snapshots\ but\ keeps\ a\ number\ of\ hourly,\ daily,\ weekly,\ monthly\ and\ yearly\ snapshots'
+ 'timeline:Deletes\ old\ snapshots\ but\ keeps\ a\ number\ of\ hourly,\ daily,\ weekly,\ monthly,\ quarterly\ and\ yearly\ snapshots'
'empty-pre-post:Deletes\ pre/post\ snapshot\ pairs\ with\ empty\ diffs'
)
local type=(single pre post)