Too few snapshots with restic forget --keep-weekly?

root@rs1:/etc# restic version
restic 0.19.0 compiled with go1.26.4 on linux/amd64

I have a cronjob which executes:

restic backup -x -H rs1 --tag _ / /home
restic forget -c --prune --tag _ --host rs1 --keep-daily 7 --keep-weekly 4

It should keep 4 weekly snapshots, but I see only 3:

# restic snapshots -g tags -c
ID        Time                 Host  Tags    Size
------------------------------------------------------
5f56b0ca  2026-06-07 00:01:24  rs1   _       6.796 GiB
f90f5cb9  2026-06-14 00:01:25  rs1   _       6.851 GiB
f04a2cb4  2026-06-17 00:01:32  rs1   _       6.799 GiB
a5b41183  2026-06-18 00:01:31  rs1   _       6.802 GiB
4cbdca8d  2026-06-19 00:01:30  rs1   _       6.806 GiB
63bfd283  2026-06-20 00:01:39  rs1   _       6.795 GiB
1a820029  2026-06-21 00:01:25  rs1   _       6.790 GiB
45858acb  2026-06-22 00:01:38  rs1   _       6.792 GiB
a008175a  2026-06-23 01:19:50  rs1   _       6.812 GiB
------------------------------------------------------
Timestamps shown in CEST timezone
9 snapshots

Shouln’t there be a 2026-05-31 snapshot ?

I get similar results on my other Linux hosts.

I see four?

5f56b0ca  2026-06-07 00:01:24  rs1   _       6.796 GiB
...
f90f5cb9  2026-06-14 00:01:25  rs1   _       6.851 GiB
...
1a820029  2026-06-21 00:01:25  rs1   _       6.790 GiB
...
a008175a  2026-06-23 01:19:50  rs1   _       6.812 GiB

The moment you flip over to the next week, the first snapshot monday morning is counted as a weekly snapshot; that’s your 4th week in the output above. Also remember restic keeps the most recent snapshot within a time period, not the oldest.

If what you actually wanted was to always be able to restore a snapshot from 4 weeks ago, you can do --keep-weekly 5, or use the --keep-within-weekly option.

I have overlooked the option --keep-within-weekly

This is indeed that, what I want. Thanks for the hint!

I found also Keep vs keep-within - #3 by noeck