restic icon indicating copy to clipboard operation
restic copied to clipboard

Pruning: `--max-unused unlimited` ignored?

Open mservices-pkowalczyk opened this issue 1 month ago • 0 comments

Output of restic version

restic 0.18.0 compiled with go1.24.1 on linux/amd64

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

Google Cloud Storage (S3)

Problem description / Steps to reproduce

To save on bandwidth, I wanted to use --max-unused unlimited, which is mentioned doing so in restic manual. However, verbose logging showed me something unexpected:

$ restic --verbose prune --max-unused unlimited

[...]

totally used packs:       2668
partly used packs:         191
unused packs:               64

to keep:            2786 packs
to repack:            73 packs
to delete:            64 packs
repacking packs
[0:05] 100.00%  73 / 73 packs repacked
rebuilding index
[0:01] 100.00%  43 / 43 indexes processed
[0:01] 100.00%  42 / 42 old indexes deleted
removing 137 old packs
[0:03] 100.00%  137 / 137 files deleted
done

Expected behavior

As I understand, restic should not touch those 73 packs marked as to repack, deleting only 64 packs

Actual behavior

73 packs were repacked, 137 packs were deleted, so 64 unused + 73 partially used. It looks like restic ignored --max-unused and actually repacked those partially used packs.

Additional info

Haven't tried the latest (v0.18.1) version as the changelog does not mention anything relevant to this case.

Did restic help you today? Did it make you happy in any way?

As advertised, it does the job right. Maybe except this time.

mservices-pkowalczyk avatar Nov 27 '25 11:11 mservices-pkowalczyk