1 % bup-prune-older(1) bup %BUP_VERSION% | bup %BUP_VERSION%
2 % Rob Browning <rlb@defaultvalue.org>
7 bup-prune-older - remove older saves
11 bup prune-older [options...] <*branch*...>
15 `bup prune-older` removes (permanently deletes) all saves except those
16 preserved by the various keep arguments detailed below. At least one
17 keep argument must be specified. This command is equivalent to a
18 suitable `bup rm` invocation followed by `bup gc`.
20 WARNING: This is one of the few bup commands that modifies your
21 archive in intentionally destructive ways. Though if an attempt to
22 `join` or `restore` the data you still care about after a
23 `prune-older` succeeds, that's a fairly encouraging sign that the
24 commands worked correctly. (The `dev/compare-trees` command in the
25 source tree can be used to help test before/after results.)
29 A `--keep` PERIOD (as required below) must be an integer followed by a
30 scale, or "forever". For example, 12y specifies a PERIOD of twelve
31 years. Here are the valid scales:
34 - min indicates minutes (60s)
35 - h indicates hours (60m)
36 - d indicates days (24h)
37 - w indicates weeks (7d)
38 - m indicates months (31d)
39 - y indicates years (366d)
40 - forever is infinitely far in the past
42 As indicated, the PERIODS are computed with respect to the current
43 time, or the `--wrt` value if specified, and do not respect any
44 calendar, so `--keep-dailies-for 5d` means a period starting exactly
45 5 * 24 * 60 * 60 seconds before the starting point.
49 \--keep-all-for PERIOD
50 : when no smaller time scale `--keep` option applies, retain all saves
51 within the given period.
53 \--keep-dailies-for PERIOD
54 : when no smaller time scale `--keep` option applies, retain the
55 newest save for any day within the given period.
57 \--keep-monthlies-for PERIOD
58 : when no smaller time scale `--keep` option applies, retain the
59 newest save for any month within the given period.
61 \--keep-yearlies-for PERIOD
62 : when no smaller time scale `--keep` option applies, retain the
63 newest save for any year within the given period.
66 : when computing a keep period, place the most recent end of the
67 range at UTC\_SECONDS, and any saves newer than this will be kept.
70 : don't do anything, just list the actions that would be taken to
71 standard output, one action per line like this:
78 : garbage collect the repository after removing the relevant saves.
79 This is the default behavior, but it can be avoided with `--no-gc`.
82 : only rewrite a packfile if it's over N percent garbage; otherwise
83 leave it alone. The default threshold is 10%.
86 : set the compression level when rewriting archive data to # (a
87 value from 0-9, where 9 is the highest and 0 is no compression).
88 The default is 1 (fast, loose compression).
91 : increase verbosity (can be specified more than once).
95 When `--verbose` is specified, the save periods will be summarized to
96 standard error with lines like this:
98 keeping monthlies since 1969-07-20-201800
102 It's possible that the current implementation might not be able to
103 format the date if, for example, it is far enough back in time. In
104 that case, you will see something like this:
106 keeping yearlies since -30109891477 seconds before 1969-12-31-180000
111 # Keep all saves for the past month, and any newer monthlies for
112 # the past year. Delete everything else.
113 $ bup prune-older --keep-all-for 1m --keep-monthlies-for 1y
115 # Keep all saves for the past 6 months and delete everything else,
116 # but only on the semester branch.
117 $ bup prune-older --keep-all-for 6m semester
121 `bup-rm`(1), `bup-gc`(1), and `bup-fsck`(1)
125 Part of the `bup`(1) suite.