Restic lists thousands of unchanged directories as "restored"

I have a restic backup that runs from a server to an S3 compatible storage provider (Dreamhost Dream Objects), which I then restore from onto another machine (my home NAS), to give me two full backups.

So the setup is:

Backup Source -> Dream Objects Bucket (repository) -> Home NAS

It’s working fine, except that every time the restore command runs I get tens of thousands of “restored” items listed in the results, even though significantly fewer than that have actually changed. This is despite having --overwrite=if-changed set.

By upping the verbosity with -vv I can see a long list of “restored” items that are just directories, but nothing about them has changed — not the modification time, not their contents, not any extended attributes etc. so I’m unsure why restic is insisting on “restoring” them every time, rather than detecting that they are unchanged and skipping them like it does for unchanged files.

Backup Command: restic backup --no-scan --quiet --skip-if-unchanged --exclude-caches /path/to/backup/source

Backup Variables (From Environment, value omitted): RESTIC_REPOSITORY, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, RESTIC_PASSWORD

Restore Command: restic restore --sparse --overwrite=if-changed --delete --exclude=.non.existent.file --target=/path/to/restore/target

Restore Command (From Environment): (as per backup variables)

I added --exclude=.non.existent.file to the restore command because it seems to be a requirement for --delete to have at least one include or exclude option but I want everything to be synchronised exactly between the remote machine’s source folder and my NAS’ target folder.

Version: restic 0.19.1 compiled with go1.26.5 on darwin/amd64

It’s a pretty minor issue, as the actual quantity of data reported as being restored seems about right (the same as the backup step) and I’m not sure much transfer activity during the directory “restores” I’m just wondering why the command is wasting so much time “restoring” things that haven’t changed despite me asking it not to, and taking longer as a result.

Is it just a current issue with directories, or is there something I can change to reduce the thousands of false positive restores?

Just wanted to add, but since I’m restoring into a ZFS dataset I’m able to see that the directory restores do seem to be resulting in writes on my restore target.

For example, if restic reports 320mb of changes, ZFS will end up with an incremental backup (send) of around 450mb, so the 10,000+ “restored” directories do seem to be resulting in a bunch of “new”/changed directory records from ZFS’ perspective.

This difference isn’t a result of compression as my restic backups contain mostly already compressed files, and ZFS is also using zstd compression so restic vs. restored sizes should be broadly the same.

Is there any way to get restic to skip directories these as unchanged? I’d prefer to minimise the changes being restored, especially if it’s resulting in tens of thousands of updated records on every restore (it’s only once per day, but still) — I guess I could use restic mount + rsync, but I’d prefer not to have to if at all possible.

I’d reproduce with the smallest repo and one file before blaming the backend.

Restic failures often look like “S3 is broken” when it’s credentials, clock skew, or a partial cache. A tiny local repro keeps the story honest.

What I’ve done is run restic copy to pull the entire repository onto the target machine (which is probably what I should be doing for replication anyway, though I liked having a restore step to verify that recovery works).

Running the same restore command from the local copy to the same target still sees the same problem — even after fully restoring (timestamps should all be correct) I’m still seeing the 10,000+ directories appearing as “restored” if I run the command again.

Since it’s fully local that should eliminate anything S3 specific as well as clock skew, and I’ve tried clearing the cache fully.

I’ve also tried running the restore command as root to eliminate permissions as an issue, and it’s exhibiting the same problem (running the restore then either running it again or using --dry-run “restores” the same 10,000+ directories) — so there shouldn’t be anything that should be causing a mismatch.

Update: Looks like this has been picked up as an issue with the restore process: