Forget --prune, but leftover files still there

I am automating my restic process and everything works fine (including recovery :slightly_smiling_face:) except a tiny annoyance: despite running forget --prune I still have leftover files:

root@srv /d/restic (master)# bin/restic version
restic 0.18.1 compiled with go1.25.1 on linux/amd64

2025-12-12 17:09:29,278 | INFO | 🏃‍♂️‍➡️ running: bin/restic -r rest:http://square.xx-yy.ts.net:8085/srv forget --prune --keep-hourly 24 --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --keep-yearly 2
2025-12-12 17:09:36,046 | INFO |
Applying Policy: keep 24 hourly, 7 daily, 4 weekly, 6 monthly, 2 yearly snapshots
keep 3 snapshots:
ID        Time                 Host        Tags        Reasons                  Paths                    Size
-------------------------------------------------------------------------------------------------------------------
118c5c03  2025-12-12 11:20:14  srv                     hourly snapshot          /etc                     35.784 GiB
                                                       oldest daily snapshot    /root
                                                       oldest weekly snapshot   /root/.config
                                                       oldest monthly snapshot  /var/lib/docker/volumes
                                                       oldest yearly snapshot

ca2d9fde  2025-12-12 14:20:50  srv                     hourly snapshot          /etc                     35.054 GiB
                                                                                /root
                                                                                /root/.config
                                                                                /var/lib/docker/volumes

4423b3b5  2025-12-12 16:47:17  srv                     hourly snapshot          /etc                     35.049 GiB
                                                       daily snapshot           /root
                                                       weekly snapshot          /root/.config
                                                       monthly snapshot         /var/lib/docker/volumes
                                                       yearly snapshot
-------------------------------------------------------------------------------------------------------------------
3 snapshots


2025-12-12 17:11:41,979 | INFO | 🏃‍♂️‍➡️ running: bin/restic -r rest:http://square.xx-yy.ts.net:8085/srv check
2025-12-12 17:12:05,627 | INFO |
using temporary cache in /tmp/restic-check-cache-2758250373
create exclusive lock for repository
load indexes
check all packs
22 additional files were found in the repo, which likely contain duplicate data.
This is non-critical, you can run `restic prune` to correct this.
check snapshots, trees and blobs
[0:13] 100.00%  3 / 3 snapshots
no errors were found

The annoying point is

22 additional files were found in the repo, which likely contain duplicate data.
This is non-critical, you can run restic prune to correct this.

Shouldn’t a forget --prune followed by a check give a clean result for the leftover files?

@Wpq can you run restic check also before you do restic forget --prune?
In that case you can prove the repo is clean and the extra data was not already present. I have seen that message a few times when a backup gets fatally interrupted before the snapshot is completed.

If the first restic check is clean then yes I agree that something unexpected is happening during the restic forget --prune step.

1 Like

Given the first piece of output, it doesn’t look like prune is run at all, or am I somehow mistaken? I don’t see any pruning going on there. There’s also other things missing - please show raw logs from raw restic instead of some wrapped thing :slight_smile:

If you manually run the command bin/restic -r rest:http://square.xx-yy.ts.net:8085/srv forget --prune --keep-hourly 24 --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --keep-yearly 2, do you get any pruning in the output?

1 Like

It seems like the forget –prune run did not remove any snapshot. IIRC the pruning only runs if there were snapshots removed. This could explain, why there is no output of the pruning.

@Wpq Can you try to run prune directly? This should remove all unused files in the repo.