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

forget should take multiple hostnames (since it can take multiple tags already) #1570

Closed
fbartels opened this issue Jan 20, 2018 · 3 comments · Fixed by #2581
Closed

forget should take multiple hostnames (since it can take multiple tags already) #1570

fbartels opened this issue Jan 20, 2018 · 3 comments · Fixed by #2581
Labels
help: good first issue easy issue to get started with for beginners (both Go and restic) help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated help: wanted type: bug

Comments

@fbartels
Copy link

fbartels commented Jan 20, 2018

The documentation at http://restic.readthedocs.io/en/latest/060_forget.html#removing-snapshots-according-to-a-policy explains how you can specify multiple tags when removing old backup revision. While you technically can specify multiple --hostname values as well, only the last is actually evaluated for the command.

Output of restic version

restic 0.8.1
compiled with go1.9.2 on linux/amd64

How did you run restic exactly?

backup my-remote forget --hostname hostname1 --hostname hostname2 --keep-hourly 4 --keep-daily 8 --keep-weekly 5 --keep-monthly 13 --keep-yearly 10

I am using https://github.com/binarybucks/restic-tools as a wrapper to easily backup to S3/minio.

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

S3

Expected behavior

List snapshots to keep and delete for all hostnames.

Actual behavior

It only lists snapshots from the last specified hostname.

Steps to reproduce the behavior

see above

Do you have any idea what may have caused this?

Looks like only the last hostname is evaluated for the forget command.

Do you have an idea how to solve the issue?

Evaluate all hostnames (just like its already the case for tags).

Did restic help you or made you happy in any way?

that's a very nice last point :-D. I've only been playing with restic for a brief time. But so far it looks very nice and extremely easy to setup. Looking forward to gather more experience with it.

@fd0
Copy link
Member

fd0 commented Jan 20, 2018

Thanks for the report, that's indeed a bit limiting. We can easily extend this so that you can specify --hostname several times. I'll keep this issue open to track it.

@fd0 fd0 added the type: bug label Jan 20, 2018
@rawtaz rawtaz added help: wanted help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated help: good first issue easy issue to get started with for beginners (both Go and restic) labels Feb 16, 2020
@rawtaz
Copy link
Contributor

rawtaz commented Feb 16, 2020

Anyone up for a PR? :)

@aawsome
Copy link
Contributor

aawsome commented Feb 17, 2020

Additionally to solving this issue for forget, I added this extension for almost all commands that take --hostname (except backup where it doesn't make sense) in #2581.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: good first issue easy issue to get started with for beginners (both Go and restic) help: minor complexity less complex issue, good for beginners that want a little challenge yet not too complicated help: wanted type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants