friend ostream& operator<<(ostream& s, const Parameters& parameters);
time_t min_age;
- double quota_limit;
+ double space_limit;
};
Parameters::Parameters(DBus::Connection& conn, const string& config_name)
- : min_age(1800), quota_limit(0.5)
+ : min_age(1800), space_limit(0.5)
{
XConfigInfo ci = command_get_xconfig(conn, config_name);
- ci.read("QUOTA_LIMIT", quota_limit);
+ ci.read("SPACE_LIMIT", space_limit);
}
operator<<(ostream& s, const Parameters& parameters)
{
return s << "min-age:" << parameters.min_age << endl
- << "quota-limit:" << parameters.quota_limit;
+ << "space-limit:" << parameters.space_limit;
}
{
XQuotaData quota_data = command_query_quota(conn, config_name);
- return quota_data.used < parameters.quota_limit * quota_data.size;
+ return quota_data.used < parameters.space_limit * quota_data.size;
}
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>SPACE_LIMIT=<replaceable>float</replaceable></option></term>
+ <listitem>
+ <para>Limit for the fraction of the filesystems space the snapshots
+ should use.</para>
+ <para>Only supported for btrfs.</para>
+ <para>Default value is "0.5".</para>
+ <para>New in version 0.3.0.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>ALLOW_USERS=<replaceable>users</replaceable></option></term>
<listitem>
</varlistentry>
<varlistentry>
- <term><option>NUMBER_LIMIT=<replaceable>number</replaceable></option></term>
+ <term><option>NUMBER_LIMIT=<replaceable>number</replaceable> or
+ <replaceable>range</replaceable></option></term>
<listitem>
<para>Defines how many snapshots the number cleanup algorithm should
keep. The youngest snapshots will be kept.</para>
</varlistentry>
<varlistentry>
- <term><option>NUMBER_LIMIT_IMPORTANT=<replaceable>number</replaceable></option></term>
+ <term><option>NUMBER_LIMIT_IMPORTANT=<replaceable>number</replaceable> or
+ <replaceable>range</replaceable></option></term>
<listitem>
<para>Defines how many important snapshots the number cleanup
algorithm should keep. Important snapshots have important=yes in the
</varlistentry>
<varlistentry>
- <term><option>TIMELINE_LIMIT_HOURLY=<replaceable>number</replaceable></option></term>
+ <term><option>TIMELINE_LIMIT_HOURLY=<replaceable>number</replaceable> or
+ <replaceable>range</replaceable></option></term>
<listitem>
<para>Defines how many hourly snapshots the timeline cleanup
algorithm should keep. An hourly snapshot is the first snapshot in an
</varlistentry>
<varlistentry>
- <term><option>TIMELINE_LIMIT_DAILY=<replaceable>number</replaceable></option></term>
+ <term><option>TIMELINE_LIMIT_DAILY=<replaceable>number</replaceable> or
+ <replaceable>range</replaceable></option></term>
<listitem>
<para>Defines how many daily snapshots the timeline cleanup
algorithm should keep. A daily snapshot is the first snapshot in a day. The
</varlistentry>
<varlistentry>
- <term><option>TIMELINE_LIMIT_WEEKLY=<replaceable>number</replaceable></option></term>
+ <term><option>TIMELINE_LIMIT_WEEKLY=<replaceable>number</replaceable> or
+ <replaceable>range</replaceable></option></term>
<listitem>
<para>Defines how many weekly snapshots the timeline cleanup
algorithm should keep. A weekly snapshot is the first snapshot in a week. The
</varlistentry>
<varlistentry>
- <term><option>TIMELINE_LIMIT_MONTHLY=<replaceable>number</replaceable></option></term>
+ <term><option>TIMELINE_LIMIT_MONTHLY=<replaceable>number</replaceable> or
+ <replaceable>range</replaceable></option></term>
<listitem>
<para>Defines how many monthly snapshots the timeline cleanup
algorithm should keep. A monthly snapshot is the first snapshot in a month. The
</varlistentry>
<varlistentry>
- <term><option>TIMELINE_LIMIT_YEARLY=<replaceable>number</replaceable></option></term>
+ <term><option>TIMELINE_LIMIT_YEARLY=<replaceable>number</replaceable> or
+ <replaceable>range</replaceable></option></term>
<listitem>
<para>Defines how many yearly snapshots the timeline cleanup
algorithm should keep. A yearly snapshot is the first snapshot in a year. The
<glossentry>
<glossterm>number</glossterm>
<glossdef>
- <para>Deletes old snapshots when a certain number of snapshots is reached.</para>
+ <para>Deletes old snapshots when a certain number of snapshots is
+ reached.</para>
</glossdef>
</glossentry>
<glossentry>
</glossdef>
</glossentry>
</glosslist>
+
+ <para>The number and timeline cleanup algorithm can also try to keep the
+ space used by snapshots below a limit. For that quota must be setup, see
+ command setup-quota, and the LIMIT variables in the config file must
+ have ranges (min- and max-value). The algorithms will then make two
+ passes:
+ <orderedlist>
+ <listitem>
+ <para>Delete snapshots above the max-value independent of the used
+ space.</para>
+ </listitem>
+ <listitem>
+ <para>Delete snapshots above the min-value until the limit for
+ the used space is reached.</para>
+ </listitem>
+ </orderedlist>
+ The limit for the used space can be configured via the SPACE_LIMIT
+ variable.
+ </para>
+
</refsect2>
<refsect2 id='filters'>