Allow --tag and --keep-tag to match untagged snapshots

This commit is contained in:
David le Blanc authored and Leo R. Lundgren committed 2021-08-02 23:06:20 +02:00
1 parent 5571c3f7fd
commit 326fefcd80
5 files changed
+43 -6

No files matched your search

+9
View File
@@ -207,6 +207,8 @@ The ``forget`` command accepts the following parameters:
boundaries and not relative to when you run the ``forget`` command. Weeks
are Monday 00:00 -> Sunday 23:59, days 00:00 to 23:59, hours :00 to :59, etc.
.. note:: Specifying ``--keep-tag ''`` will match untagged snapshots only.
Multiple policies will be ORed together so as to be as inclusive as possible
for keeping snapshots.
@@ -234,6 +236,13 @@ To only keep the last snapshot of all snapshots with both the tag ``foo`` and
$ restic forget --tag foo,bar --keep-last 1
To ensure only untagged snapshots are considered, specify the empty string '' as
the tag.
.. code-block:: console
$ restic forget --tag '' --keep-last 1
All the ``--keep-*`` options above only count
hours/days/weeks/months/years which have a snapshot, so those without a
snapshot are ignored.