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 after forget was run successfully, go look at the prune command. 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 including tag[,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 suffixes k/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 like 5m or 2h (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