bup-prune-older - remove older saves (CAUTION: EXPERIMENTAL)
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
WARNING: This is one of the few bup commands that modifies your archive in intentionally destructive ways. Though if an attempt to
restore the data you still care about after a
prune-older succeeds, that's a fairly encouraging sign that the commands worked correctly. (The
t/compare-trees command in the source tree can be used to help test before/after results.)
--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.
don't do anything, just list the actions that would be taken to standard output, one action per line like this:
- SAVE + SAVE ...
--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 older 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
Part of the