1 % bup-prune-older(1) bup %BUP_VERSION% | bup %BUP_VERSION%
2 % Rob Browning <rlb@defaultvalue.org>
7 bup-prune-older - remove older saves (CAUTION: EXPERIMENTAL)
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 `t/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.
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 oldest 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 oldest 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 oldest save for any year within the given period.
65 --keep ALL,DAILY,MONTHLY,YEARLY
66 : shorthand equivalent to specifying each of the related `--keep-*`
67 options for each period. If an underscore is specified for a
68 period, then that time-scale will be unaffected by this argument.
71 : when computing a keep period, place the most recent end of the
72 range at UTC\_SECONDS, and any saves newer than this will be kept.
75 : don't do anything, just list the actions that would be taken to
76 standard output, one action per line like this:
83 : garbage collect the repository after removing the relevant saves.
84 This is the default behavior, but it can be avoided with `--no-gc`.
87 : only rewrite a packfile if it's over N percent garbage; otherwise
88 leave it alone. The default threshold is 10%.
91 : set the compression level when rewriting archive data to # (a
92 value from 0-9, where 9 is the highest and 0 is no compression).
93 The default is 1 (fast, loose compression).
96 : increase verbosity (can be specified more than once).
100 When `--verbose` is specified, the save periods will be summarized to
101 standard error with lines like this:
103 keeping monthlies since 1969-07-20-201800
107 It's possible that the current implementation might not be able to
108 format the date if, for example, it is far enough back in time. In
109 that case, you will see something like this:
111 keeping yearlies since -30109891477 seconds before 1969-12-31-180000
116 # Keep all saves for the past month, and any older monthlies for
117 # the past year. Delete everything else.
118 $ bup prune-older --keep-all-for 1m --keep-monthlies-for 1y
120 # Keep all saves for the past 6 months and delete everything else,
121 # but only on the semester branch.
122 $ bup prune-older --keep-all-for 6m semester
126 `bup-rm`(1), `bup-gc`(1), and `bup-fsck`(1)
130 Part of the `bup`(1) suite.