RESTIC-FORGET(1)
NAME
restic-forget β Remove snapshots from the repository π
β¨
(and yes bestie, this is the manual page for the forget command from the restic crew β page restic-forget(1), let's get into it π¦)
SYNOPSIS
restic forget [flags] [snapshot ID] [...]
DESCRIPTION
okay so the forget command removes snapshots according to a policy. that's the whole vibe. but the way it does it is lowkey the important part π
first, all snapshots get divided into groups according to --group-by, and then the policy you specified with the --keep- options gets applied to each group individually. so like, each group gets its own lil vibe check. π
and if there are not enough snapshots to keep one for each duration related --keep-{within-,} option, then the oldest snapshot in the group is kept additionally. she's the safety net, no cap π«Ά
bestie. listen. please note that this command really only deletes the snapshot object in the repository, which is a reference to data stored there. so the actual data? still chillin'. it's giving "not gone, just unlinked" π. in order to remove the unreferenced data afterforgetwas run successfully, go look at theprunecommand. periodt.
also please read the documentation for forget to learn about some important security considerations β i'm not being dramatic, there's genuinely stuff you wanna know before you start yeeting snapshots π₯
EXIT STATUS
she'll tell you exactly how it went, here's the decoder ring π:
0β the command was successful. slay. ate. π1β there was any error. π3β there was an error removing one or more snapshots. π10β the repository does not exist. π11β the repository is already locked. π12β the password is incorrect. π
OPTIONS
all the knobs and dials, bestie, every single one πΈ:
-l,--keep-last=0β keep the last n snapshots (use'unlimited'to keep all snapshots)-H,--keep-hourly=0β keep the last n hourly snapshots (use'unlimited'to keep all hourly snapshots)-d,--keep-daily=0β keep the last n daily snapshots (use'unlimited'to keep all daily snapshots)-w,--keep-weekly=0β keep the last n weekly snapshots (use'unlimited'to keep all weekly snapshots)-m,--keep-monthly=0β keep the last n monthly snapshots (use'unlimited'to keep all monthly snapshots)-y,--keep-yearly=0β keep the last n yearly snapshots (use'unlimited'to keep all yearly snapshots)--keep-within=β keep snapshots that are newer than duration (eg.1y5m7d2h) relative to the latest snapshot--keep-within-hourly=β keep hourly snapshots that are newer than duration (eg.1y5m7d2h) relative to the latest snapshot--keep-within-daily=β keep daily snapshots that are newer than duration (eg.1y5m7d2h) relative to the latest snapshot--keep-within-weekly=β keep weekly snapshots that are newer than duration (eg.1y5m7d2h) relative to the latest snapshot--keep-within-monthly=β keep monthly snapshots that are newer than duration (eg.1y5m7d2h) relative to the latest snapshot--keep-within-yearly=β keep yearly snapshots that are newer than duration (eg.1y5m7d2h) relative to the latest snapshot--keep-tag=[]β keep snapshots with this taglist (can be specified multiple times)--unsafe-allow-remove-all[=false]β allow deleting all snapshots of a snapshot group β οΈ (the name literally says unsafe bestie, she means it)--host=[]β only consider snapshots for this host (can be specified multiple times, use empty string to unset default value) (default:$RESTIC_HOST)--tag=[]β only consider snapshots includingtag[,tag,...](can be specified multiple times)--path=[]β only consider snapshots including this (absolute) path (can be specified multiple times, snapshots must include all specified paths)-c,--compact[=false]β use compact output format-g,--group-by=host,pathsβ group snapshots by host, paths and/or tags, separated by comma (disable grouping with'')-n,--dry-run[=false]β do not delete anything, just print what would be done β¨ (iconic behaviour honestly, test before you wreck)--prune[=false]β automatically run the'prune'command if snapshots have been removed--max-unused="5%"β tolerate given limit of unused data (absolute value in bytes with suffixesk/K,m/M,g/G,t/T, a value in%or the word'unlimited')--max-repack-size=""β stop after repacking this much data in total (allowed suffixes for size:k/K,m/M,g/G,t/T)--repack-cacheable-only[=false]β only repack packs which are cacheable--repack-uncompressed[=false]β repack all uncompressed data--repack-smaller-than=""β pack below-limit packfiles (allowed suffixes:m/M)-h,--help[=false]β help for forget π
OPTIONS INHERITED FROM PARENT COMMANDS
these ones came from the parent command, she brought her whole entourage π :
--cacert=[]β file to load root certificates from (default: use system certificates or$RESTIC_CACERT)--cache-dir=""β set the cache directory. (default: use system default cache directory)--cleanup-cache[=false]β auto remove old cache directories--compression=autoβ compression mode (only available for repository format version 2), one of (auto|off|fastest|better|max) (default:$RESTIC_COMPRESSION)--http-user-agent=""β set a http user agent for outgoing http requests--insecure-no-password[=false]β use an empty password for the repository, must be passed to every restic command (insecure) π¨--insecure-tls[=false]β skip TLS certificate verification when connecting to the repository (insecure) π¨--json[=false]β set output mode to JSON for commands that support it--key-hint=""β key ID of key to try decrypting first (default:$RESTIC_KEY_HINT)--limit-download=0β limits downloads to a maximum rate in KiB/s. (default: unlimited)--limit-upload=0β limits uploads to a maximum rate in KiB/s. (default: unlimited)--no-cache[=false]β do not use a local cache--no-extra-verify[=false]β skip additional verification of data before upload (see documentation)--no-lock[=false]β do not lock the repository, this allows some operations on read-only repositories-o,--option=[]β set extended option (key=value, can be specified multiple times)--pack-size=0β set target pack size in MiB, created pack files may be larger (default:$RESTIC_PACK_SIZE)--password-command=""β shell command to obtain the repository password from (default:$RESTIC_PASSWORD_COMMAND)-p,--password-file=""β file to read the repository password from (default:$RESTIC_PASSWORD_FILE)-q,--quiet[=false]β do not output comprehensive progress report-r,--repo=""β repository to backup to or restore from (default:$RESTIC_REPOSITORY)--repository-file=""β file to read the repository location from (default:$RESTIC_REPOSITORY_FILE)--retry-lock=0sβ retry to lock the repository if it is already locked, takes a value like5mor2h(default: no retries)--stuck-request-timeout=5m0sβ duration after which to retry stuck requests--tls-client-cert=""β path to a file containing PEM encoded TLS client certificate and private key (default:$RESTIC_TLS_CLIENT_CERT)-v,--verbose[=0]β be verbose (specify multiple times or a level using--verbose=n, max level/times is 2)
SEE ALSO
restic(1)β go read the big one bestie, she's the main character π
and that's the whole page, babes π this one was generated by restic generate, dated Jan 2017, and yeah the footer still says restic backup(1) β she's wearing her backup-era header like a vintage jacket, we love a nostalgic queen π¦ mwah, go forth and forget responsibly π
π¦ where this page comes from
- arch rolling: restic 0.19.1-1 Β· BSD
- epel 10: restic 0.19.1-1.el10_3 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND MPL-2.0
- epel 9: restic 0.19.1-1.el9 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND MPL-2.0
- fedora 43: restic 0.19.1-1.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND MPL-2.0
- fedora 44: restic 0.19.1-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND MPL-2.0
- nixpkgs unstable: restic 0.19.1
- ubuntu stonking: restic 0.19.1-1ubuntu1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms