1restic backup(1)                                              restic backup(1)
2
3
4

NAME

6       restic-forget - Remove snapshots from the repository
7
8
9

SYNOPSIS

11       restic forget [flags] [snapshot ID] [...]
12
13
14

DESCRIPTION

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

EXIT STATUS

34       Exit status is 0 if the command was successful, and non-zero  if  there
35       was any error.
36
37
38

OPTIONS

40       -l, --keep-last=0      keep the last n snapshots
41
42
43       -H, --keep-hourly=0      keep the last n hourly snapshots
44
45
46       -d, --keep-daily=0      keep the last n daily snapshots
47
48
49       -w, --keep-weekly=0      keep the last n weekly snapshots
50
51
52       -m, --keep-monthly=0      keep the last n monthly snapshots
53
54
55       -y, --keep-yearly=0      keep the last n yearly snapshots
56
57
58       --keep-within=       keep  snapshots  that are newer than duration (eg.
59       1y5m7d2h) relative to the latest snapshot
60
61
62       --keep-within-hourly=      keep hourly snapshots that  are  newer  than
63       duration (eg. 1y5m7d2h) relative to the latest snapshot
64
65
66       --keep-within-daily=       keep daily snapshots that are newer than du‐
67       ration (eg. 1y5m7d2h) relative to the latest snapshot
68
69
70       --keep-within-weekly=      keep weekly snapshots that  are  newer  than
71       duration (eg. 1y5m7d2h) relative to the latest snapshot
72
73
74       --keep-within-monthly=       keep monthly snapshots that are newer than
75       duration (eg. 1y5m7d2h) relative to the latest snapshot
76
77
78       --keep-within-yearly=      keep yearly snapshots that  are  newer  than
79       duration (eg. 1y5m7d2h) relative to the latest snapshot
80
81
82       --keep-tag=[]       keep  snapshots with this taglist (can be specified
83       multiple times)
84
85
86       --host=[]      only consider snapshots with  the  given  host  (can  be
87       specified multiple times)
88
89
90       --tag=[]      only consider snapshots which include this taglist in the
91       format tag[,tag,...] (can be specified multiple times)
92
93
94       --path=[]      only consider snapshots which  include  this  (absolute)
95       path (can be specified multiple times)
96
97
98       -c, --compact[=false]      use compact output format
99
100
101       -g,  --group-by="host,paths"      group snapshots by host, paths and/or
102       tags, separated by comma (disable grouping with '')
103
104
105       -n, --dry-run[=false]      do not  delete  anything,  just  print  what
106       would be done
107
108
109       --prune[=false]      automatically run the 'prune' command if snapshots
110       have been removed
111
112
113       --max-unused="5%"      tolerate given limit of  unused  data  (absolute
114       value  in  bytes  with suffixes k/K, m/M, g/G, t/T, a value in % or the
115       word 'unlimited')
116
117
118       --max-repack-size=""      maximum size  to  repack  (allowed  suffixes:
119       k/K, m/M, g/G, t/T)
120
121
122       --repack-cacheable-only[=false]      only repack packs which are cache‐
123       able
124
125
126       --repack-small[=false]      repack pack files below 80% of target  pack
127       size
128
129
130       --repack-uncompressed[=false]      repack all uncompressed data
131
132
133       -h, --help[=false]      help for forget
134
135
136

OPTIONS INHERITED FROM PARENT COMMANDS

138       --cacert=[]      file to load root certificates from (default: use sys‐
139       tem certificates)
140
141
142       --cache-dir=""      set the cache directory. (default: use  system  de‐
143       fault cache directory)
144
145
146       --cleanup-cache[=false]      auto remove old cache directories
147
148
149       --compression=auto      compression mode (only available for repository
150       format version 2), one of (auto|off|max)
151
152
153       --insecure-tls[=false]      skip TLS certificate verification when con‐
154       necting to the repository (insecure)
155
156
157       --json[=false]       set  output mode to JSON for commands that support
158       it
159
160
161       --key-hint=""      key ID of key  to  try  decrypting  first  (default:
162       $RESTIC_KEY_HINT)
163
164
165       --limit-download=0       limits  downloads  to a maximum rate in KiB/s.
166       (default: unlimited)
167
168
169       --limit-upload=0      limits uploads to a maximum rate in  KiB/s.  (de‐
170       fault: unlimited)
171
172
173       --no-cache[=false]      do not use a local cache
174
175
176       --no-lock[=false]      do not lock the repository, this allows some op‐
177       erations on read-only repositories
178
179
180       -o, --option=[]      set extended option (key=value, can  be  specified
181       multiple times)
182
183
184       --pack-size=0       set target pack size in MiB, created pack files may
185       be larger (default: $RESTIC_PACK_SIZE)
186
187
188       --password-command=""      shell command to obtain the repository pass‐
189       word from (default: $RESTIC_PASSWORD_COMMAND)
190
191
192       -p,  --password-file=""       file to read the repository password from
193       (default: $RESTIC_PASSWORD_FILE)
194
195
196       -q, --quiet[=false]      do not output comprehensive progress report
197
198
199       -r, --repo=""      repository to backup to or  restore  from  (default:
200       $RESTIC_REPOSITORY)
201
202
203       --repository-file=""       file  to  read  the repository location from
204       (default: $RESTIC_REPOSITORY_FILE)
205
206
207       --tls-client-cert=""      path to a file  containing  PEM  encoded  TLS
208       client certificate and private key
209
210
211       -v,  --verbose[=0]       be  verbose (specify multiple times or a level
212       using --verbose=n, max level/times is 3)
213
214
215

SEE ALSO

217       restic(1)
218
219
220
221generated by restic generate       Jan 2017                   restic backup(1)
Impressum