Skip to content

restic forget --keep-tag NonExistingTag drops all snapshots #4569

@schoettl

Description

@schoettl

Output of restic version

restic 0.16.2-dev (compiled manually) compiled with go1.20.8 on linux/amd64

What backend/service did you use to store the repository?

local fs / applies to all

Problem description / Steps to reproduce

restic forget --keep-tag=SomeUnusedTag --dry-run

This command would drop all snapshots. This is very dangerous and probably unwanted.

A suggested fix (see forum) is to only allow --keep-tag together with other --keep-* options.

While working on this, I noticed that another if case seem to have no effect, see comment in diff.
Was the change previously discussed in an issue or on the forum?

See also https://forum.restic.net/t/delete-all-snapshots-in-one-command-is-this-feature-intentional/6923/3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions