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.
restic version
restic 0.8.1
compiled with go1.9.2 on linux/amd64
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.
S3
List snapshots to keep and delete for all hostnames.
It only lists snapshots from the last specified hostname.
see above
Looks like only the last hostname is evaluated for the forget command.
Evaluate all hostnames (just like its already the case for tags).
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.
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.
Most helpful comment
Additionally to solving this issue for
forget
, I added this extension for almost all commands that take--hostname
(exceptbackup
where it doesn't make sense) in #2581.