From 375868edcf60351ba3c8c3617a2f4640162b7eab Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 13 May 2018 12:54:23 +0200 Subject: [PATCH] Add documentation --- changelog/unreleased/pull-1735 | 9 +++++++++ doc/060_forget.rst | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 changelog/unreleased/pull-1735 diff --git a/changelog/unreleased/pull-1735 b/changelog/unreleased/pull-1735 new file mode 100644 index 000000000..2cfd115d8 --- /dev/null +++ b/changelog/unreleased/pull-1735 @@ -0,0 +1,9 @@ +Enhancement: Allow keeping a time range of snaphots + +We've added the `--keep-within` option to the `forget` command. It instructs +restic to keep all snapshots within the given duration since the newest +snapshot. For example, running `restic forget --keep-within 5m7d` will keep all +snapshots which have been made in the five months and seven days since the +latest snapshot. + +https://github.com/restic/restic/pull/1735 diff --git a/doc/060_forget.rst b/doc/060_forget.rst index ab5274758..1ca614a79 100644 --- a/doc/060_forget.rst +++ b/doc/060_forget.rst @@ -159,6 +159,10 @@ The ``forget`` command accepts the following parameters: snapshots, only keep the last one for that year. - ``--keep-tag`` keep all snapshots which have all tags specified by this option (can be specified multiple times). +- ``--keep-within duration`` keep all snapshots which have been made within + the duration of the latest snapshot. ``duration`` needs to be a number of + years, months, and days, e.g. ``2y5m7d`` will keep all snapshots made in the + two years, five months, and seven days before the latest snapshot. Additionally, you can restrict removing snapshots to those which have a particular hostname with the ``--hostname`` parameter, or tags with the