1restic backup(1) restic backup(1)
2
3
4
6 restic-forget - Remove snapshots from the repository
7
8
9
11 restic forget [flags] [snapshot ID] [...]
12
13
14
16 The "forget" command removes snapshots according to a policy. All snap‐
17 shots are first divided into groups according to "--group-by", and af‐
18 ter that the policy specified by the "--keep-*" options is applied to
19 each group individually.
20
21
22 Please note that this command really only deletes the snapshot object
23 in the repository, which is a reference to data stored there. In order
24 to remove the unreferenced data after "forget" was run successfully,
25 see the "prune" command.
26
27
28 Please also read the documentation for "forget" to learn about some im‐
29 portant security considerations.
30
31
32
34 Exit status is 0 if the command was successful, and non-zero if there
35 was any error.
36
37
38
40 -l, --keep-last=0 keep the last n snapshots (use 'unlimited' to
41 keep all snapshots)
42
43
44 -H, --keep-hourly=0 keep the last n hourly snapshots (use 'unlim‐
45 ited' to keep all hourly snapshots)
46
47
48 -d, --keep-daily=0 keep the last n daily snapshots (use 'unlim‐
49 ited' to keep all daily snapshots)
50
51
52 -w, --keep-weekly=0 keep the last n weekly snapshots (use 'unlim‐
53 ited' to keep all weekly snapshots)
54
55
56 -m, --keep-monthly=0 keep the last n monthly snapshots (use 'un‐
57 limited' to keep all monthly snapshots)
58
59
60 -y, --keep-yearly=0 keep the last n yearly snapshots (use 'unlim‐
61 ited' to keep all yearly snapshots)
62
63
64 --keep-within= keep snapshots that are newer than duration (eg.
65 1y5m7d2h) relative to the latest snapshot
66
67
68 --keep-within-hourly= keep hourly snapshots that are newer than
69 duration (eg. 1y5m7d2h) relative to the latest snapshot
70
71
72 --keep-within-daily= keep daily snapshots that are newer than du‐
73 ration (eg. 1y5m7d2h) relative to the latest snapshot
74
75
76 --keep-within-weekly= keep weekly snapshots that are newer than
77 duration (eg. 1y5m7d2h) relative to the latest snapshot
78
79
80 --keep-within-monthly= keep monthly snapshots that are newer than
81 duration (eg. 1y5m7d2h) relative to the latest snapshot
82
83
84 --keep-within-yearly= keep yearly snapshots that are newer than
85 duration (eg. 1y5m7d2h) relative to the latest snapshot
86
87
88 --keep-tag=[] keep snapshots with this taglist (can be specified
89 multiple times)
90
91
92 --host=[] only consider snapshots for this host (can be specified
93 multiple times)
94
95
96 --tag=[] only consider snapshots including tag[,tag,...] (can be
97 specified multiple times)
98
99
100 --path=[] only consider snapshots including this (absolute) path
101 (can be specified multiple times)
102
103
104 -c, --compact[=false] use compact output format
105
106
107 -g, --group-by=host,paths group snapshots by host, paths and/or
108 tags, separated by comma (disable grouping with '')
109
110
111 -n, --dry-run[=false] do not delete anything, just print what
112 would be done
113
114
115 --prune[=false] automatically run the 'prune' command if snapshots
116 have been removed
117
118
119 --max-unused="5%" tolerate given limit of unused data (absolute
120 value in bytes with suffixes k/K, m/M, g/G, t/T, a value in % or the
121 word 'unlimited')
122
123
124 --max-repack-size="" maximum size to repack (allowed suffixes:
125 k/K, m/M, g/G, t/T)
126
127
128 --repack-cacheable-only[=false] only repack packs which are cache‐
129 able
130
131
132 --repack-small[=false] repack pack files below 80% of target pack
133 size
134
135
136 --repack-uncompressed[=false] repack all uncompressed data
137
138
139 -h, --help[=false] help for forget
140
141
142
144 --cacert=[] file to load root certificates from (default: use sys‐
145 tem certificates or $RESTIC_CACERT)
146
147
148 --cache-dir="" set the cache directory. (default: use system de‐
149 fault cache directory)
150
151
152 --cleanup-cache[=false] auto remove old cache directories
153
154
155 --compression=auto compression mode (only available for repository
156 format version 2), one of (auto|off|max) (default: $RESTIC_COMPRESSION)
157
158
159 --insecure-tls[=false] skip TLS certificate verification when con‐
160 necting to the repository (insecure)
161
162
163 --json[=false] set output mode to JSON for commands that support
164 it
165
166
167 --key-hint="" key ID of key to try decrypting first (default:
168 $RESTIC_KEY_HINT)
169
170
171 --limit-download=0 limits downloads to a maximum rate in KiB/s.
172 (default: unlimited)
173
174
175 --limit-upload=0 limits uploads to a maximum rate in KiB/s. (de‐
176 fault: unlimited)
177
178
179 --no-cache[=false] do not use a local cache
180
181
182 --no-lock[=false] do not lock the repository, this allows some op‐
183 erations on read-only repositories
184
185
186 -o, --option=[] set extended option (key=value, can be specified
187 multiple times)
188
189
190 --pack-size=0 set target pack size in MiB, created pack files may
191 be larger (default: $RESTIC_PACK_SIZE)
192
193
194 --password-command="" shell command to obtain the repository pass‐
195 word from (default: $RESTIC_PASSWORD_COMMAND)
196
197
198 -p, --password-file="" file to read the repository password from
199 (default: $RESTIC_PASSWORD_FILE)
200
201
202 -q, --quiet[=false] do not output comprehensive progress report
203
204
205 -r, --repo="" repository to backup to or restore from (default:
206 $RESTIC_REPOSITORY)
207
208
209 --repository-file="" file to read the repository location from
210 (default: $RESTIC_REPOSITORY_FILE)
211
212
213 --retry-lock=0s retry to lock the repository if it is already
214 locked, takes a value like 5m or 2h (default: no retries)
215
216
217 --tls-client-cert="" path to a file containing PEM encoded TLS
218 client certificate and private key (default: $RESTIC_TLS_CLIENT_CERT)
219
220
221 -v, --verbose[=0] be verbose (specify multiple times or a level
222 using --verbose=n``, max level/times is 2)
223
224
225
227 restic(1)
228
229
230
231generated by restic generate Jan 2017 restic backup(1)