Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"--prune" Appended To "forget" Command - Unknown Flag #870

Closed
AndrewPaglusch opened this issue Mar 8, 2017 · 6 comments
Closed

"--prune" Appended To "forget" Command - Unknown Flag #870

AndrewPaglusch opened this issue Mar 8, 2017 · 6 comments

Comments

@AndrewPaglusch
Copy link

Output of restic version

./restic version
restic 0.4.0 (v0.4.0-0-ga7c2f28-dirty)
compiled with go1.7.5 on linux/amd64

Expected behavior

I would expect, according to the following excerpt from the documentation (here), that the last 2 backups would be forgotten and then pruned in the same command.

From the documentation:

You can automate this two-step process by using the --prune switch to forget:
$ restic forget --keep-last 1 --prune

Actual behavior

./restic -r BAKREPO/ --password-file .password forget --keep-last 2 --prune
unknown flag: --prune

Steps to reproduce the behavior

Try to run the "forget" command with a policy (--keep-last X) and append "--prune" to the end, like the following:

# ./restic -r BAKREPO/ --password-file .password forget --keep-last 2 --prune

@middelink
Copy link
Member

Does the flag show when you run ./restic forget --help?

@AndrewPaglusch
Copy link
Author

I don't believe it does. Please see below:

# ./restic forget --help
The "forget" command removes snapshots according to a policy. Please note that
this command really only deletes the snapshot object in the repository, which
is a reference to data stored there. In order to remove this (now unreferenced)
data after 'forget' was run successfully, see the 'prune' command.

Usage:
  restic forget [flags] [snapshot ID] [...]

Flags:
  -n, --dry-run           do not delete anything, just print what would be done
      --hostname string   only forget snapshots for the given hostname
  -d, --keep-daily n      keep the last n daily snapshots
  -H, --keep-hourly n     keep the last n hourly snapshots
  -l, --keep-last n       keep the last n snapshots
  -m, --keep-monthly n    keep the last n monthly snapshots
      --keep-tag tag      always keep snapshots with this tag (can be specified multiple times)
  -w, --keep-weekly n     keep the last n weekly snapshots
  -y, --keep-yearly n     keep the last n yearly snapshots
      --tag tag           only forget snapshots with the tag (can be specified multiple times)

Global Flags:
      --no-lock                do not lock the repo, this allows some operations on read-only repos
  -p, --password-file string   read the repository password from a file
  -q, --quiet                  do not output comprehensive progress report
  -r, --repo string            repository to backup to or restore from (default: $RESTIC_REPOSITORY)

@middelink
Copy link
Member

Nope. which means... Well, i don't know what it means. Did you checkout the source yourself? And if so, from head? or from a tagged branch?

Oh, I see. the 4.0 tagger branch has the issue.

@middelink
Copy link
Member

middelink commented Mar 8, 2017

It was added to the main branch in
685f5eb

You are probably looking at the most recent documentation and using an older binary. Either stop using the flag or rebuild your binary yourself from a recent enough master to include the above commit.

@AndrewPaglusch
Copy link
Author

Thank you for your help @middelink. I had downloaded the latest release. I think you're probably correct about me having a binary that the documentation is too new for.

@fd0
Copy link
Member

fd0 commented Mar 9, 2017

Ah, you've looked at the docs for the latest master (https://restic.readthedocs.io/en/latest/), the ones for the released version are here: https://restic.readthedocs.io/en/stable/

You can switch versions in the menu in the lower left corner. They are also both linked from the website https://restic.github.io.

I'm going to close this for now, if you have any ideas on how to improve the docs (or the links to the docs), please add a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants