Restic: forget should take multiple hostnames (since it can take multiple tags already)

Created on 20 Jan 2018  ·  3Comments  ·  Source: restic/restic

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.

good first issue minor complexity wanted bug

Most helpful comment

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.

All 3 comments

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.

Anyone up for a PR? :)

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.

Was this page helpful?
0 / 5 - 0 ratings