Pruning an S3/B2 repo does not delete any files

I recently started using S3-compatible buckets for restic, and used rclone to copy the repos from the old buckets to the new ones. Ever since, my repos have been growing, despite periodic forgetting and pruning. I set the lifecycle setting on B2 for the bucket to keep only the latest versions, and that changed nothing. I talked to Backblaze tech support, and they told me that it might take 48 hours, but that I should get help from the restic folks in any case

I waited 48 hours, and my repo was, if anything, a little bigger. I removed over 90% of the snapshots (and these were for distinct files, so there would be no overlap) and still no change. I used rclone to look at the repo’s corresponding bucket, and it showed a much smaller set of files than what I got when I looked at the same bucket using the B2 web page

My question is how can I make sure that having restic prune a repo actually removes the files in question, and failing that, is there some way to remove all of the unneeded files

My restic versions are 0.15.0 compiled with go1.19.5 on linux/386 and windows/amd64

There is this note in the docs that I don’t understand

Different from the B2 backend, restic’s S3 backend will only hide no longer necessary files. Thus, make sure to setup lifecycle rules to eventually delete hidden files.

Using “Keep only the last version of the file” worked with B2’s non-S3 API, but I notice under “Use custom lifecycle rules” there is daysFromHidingToDeleting so maybe it’s a separate operation. I’m still converting my repo to an S3-enabled bucket, but might have more insights in a few weeks.

Were the lifecycle rules set to “Keep only the last version of the file” at the time of the prune?

After a few days, everything started working. I came back here to let everybody know but could not find my post. To answer your question, yes, “Keep only the last version of the file” at the time I did my pruning. After everything started to work, I believe that setting that flag for my other repos deleted the all-but-current versions of the files without an explicit prune

According to Lifecycle Rules the “Keep only the last version of the file” option translates to a lifecycle rule that deletes hidden files after one day.

We can change the wording in restic’s documentation if you have a suggestion.