0.33.2
bup-prune-older - remove older saves
bup prune-older [options…] <branch…>
bup prune-older
removes (permanently deletes) all saves
except those preserved by the various keep arguments detailed below. At
least one keep argument must be specified. This command is equivalent to
a suitable bup rm
invocation followed by
bup gc
.
WARNING: This is one of the few bup commands that modifies your
archive in intentionally destructive ways. Though if an attempt to
join
or restore
the data you still care about
after a prune-older
succeeds, that’s a fairly encouraging
sign that the commands worked correctly. (The
dev/compare-trees
command in the source tree can be used to
help test before/after results.)
A --keep
PERIOD (as required below) must be an integer
followed by a scale, or “forever”. For example, 12y specifies a PERIOD
of twelve years. Here are the valid scales:
As indicated, the PERIODS are computed with respect to the current
time, or the --wrt
value if specified, and do not respect
any calendar, so --keep-dailies-for 5d
means a period
starting exactly 5 * 24 * 60 * 60 seconds before the starting point.
--keep
option applies, retain
all saves within the given period.
--keep
option applies, retain
the newest save for any day within the given period.
--keep
option applies, retain
the newest save for any month within the given period.
--keep
option applies, retain
the newest save for any year within the given period.
don’t do anything, just list the actions that would be taken to standard output, one action per line like this:
- SAVE
+ SAVE
...
--no-gc
.
When --verbose
is specified, the save periods will be
summarized to standard error with lines like this:
keeping monthlies since 1969-07-20-201800
keeping all yearlies
...
It’s possible that the current implementation might not be able to format the date if, for example, it is far enough back in time. In that case, you will see something like this:
keeping yearlies since -30109891477 seconds before 1969-12-31-180000
...
# Keep all saves for the past month, and any newer monthlies for
# the past year. Delete everything else.
$ bup prune-older --keep-all-for 1m --keep-monthlies-for 1y
# Keep all saves for the past 6 months and delete everything else,
# but only on the semester branch.
$ bup prune-older --keep-all-for 6m semester
bup-rm
(1), bup-gc
(1), and
bup-fsck
(1)
Part of the bup
(1) suite.