All dirs changed with every backup

I get output like this with every backup:

🗄️ Starting Backup Process
Source Restic Credentials
Start Restic Backup
using parent snapshot 6fe0c0c7

Files:           0 new,    68 changed, 63625 unmodified
Dirs:            0 new, 18892 changed,     0 unmodified
Added to the repository: 41.678 MiB (12.332 MiB stored)

processed 63693 files, 22.058 GiB in 0:17
snapshot 962ce1a8 saved
âś… Backup Completed Successfully

Notice the 0 unmodified in Dirs: 0 new, 18892 changed, 0 unmodified
I expected only a few dirs to have changed; certainly not all of them.

I think this is happening because I mount and backup from an APFS-snapshot.
Can or should I do something about it?

Here’s the full technical details on my setup: Restic Backup from macOS Apple APFS Snapshot of External Drive (without Time Machine)

restic version
restic 0.18.1 compiled with go1.25.1 on darwin/arm64

Amazon AWS S3 Backend

macOS 26.1 (25B78)

restic backup \
	--host "$RESTIC_HOST" \
	--files-from "$RESTIC_INCLUDES_FILE" \
	--exclude-file "$RESTIC_EXCLUDES_FILE" \
	--one-file-system \
	--cache-dir "$RESTIC_CACHE_DIR" \
	--cleanup-cache \
	--compression max \
	--limit-download "$RESTIC_LIMIT_DOWNLOAD" \
	--limit-upload "$RESTIC_LIMIT_UPLOAD" \
	-o s3.storage-class=INTELLIGENT_TIERING

All commands executed as root

I think it is the same issue as with ZFS. Rather old story…

For exactly this reason I started using rustic (which is restic repo format compatible but handles some things differently).

2 Likes

Oh no that’s not good for me:

🗄️ Starting Backup Process
Source Restic Credentials
Start Restic Backup
using parent snapshot 797ab776

Files:           5 new,   122 changed, 765679 unmodified
Dirs:            0 new, 120484 changed,     0 unmodified
Added to the repository: 351.570 MiB (89.666 MiB stored)

processed 765806 files, 55.888 GiB in 2:26
snapshot b215cda3 saved
âś… Backup Completed Successfully

This will accumulate quickly.

Thank you for sharing! It’s amazing to see there’s already another project thats compatible with the repository format! What’s your overall experience?

Thanks again @kapitainsky; your link pointed me to the right direction:

🗄️ Starting Backup Process
Source Restic Credentials
Start Restic Backup
using parent snapshot 936e7cac

Files:           0 new,    56 changed, 765750 unmodified
Dirs:            0 new,    46 changed, 120438 unmodified
Added to the repository: 7.455 MiB (1.079 MiB stored)

processed 765806 files, 55.888 GiB in 2:22
snapshot a6252802 saved
âś… Backup Completed Successfully

Only had to make this small change:

export RESTIC_FEATURES="device-id-for-hardlinks"

See archiver: only store deviceID for hardlinks by MichaelEischer · Pull Request #4006 · restic/restic · GitHub for details.

1 Like

Very positive. Features I am using (and not available in restic yet) are:

  • lock free operations
  • cold storage support
  • various script’s hooks
  • toml files based configuration

In general rustic contains today many features that are only planned in restic maintaining full repository compatibility at the same time.

I still use restic though too. I like the idea that there is more than one program I can rely on to access my backups. So I wish the best for both projects:)

1 Like

@hettiger Thanks for reporting back the solution.
As a note for future readers, I learned that features are not only hidden in github but can be shown at the commandline via restic features (restic v0.17+).

4 Likes

Thats super cool. Thank you for sharing your experience.

I didn’t know this. That’s really good to know. Thank you!

1 Like

Probably the directories are really have changed, at least their access-time. It is recommended anyway to turn off directory access time update in filesystems if it is not really necessary, since it does a huge number of inode updates on the media even after you do an ls -l .

e.g. in /etc/fstab:

LABEL=store /store btrfs defaults,nofail,noatime,nodiratime0 0
LABEL=root / ext4 defaults,discard,noatime,nodiratime,errors=remount-ro

You can check the differences with “restic diff” and check the directory data by “restic mount” and then do a stat on them:

$ stat /mnt/snapshots/latest/usr
File: /mnt/snapshots/latest/usr
Size: 0 Blocks: 0 IO Block: 4096 directory
Device: 0,115 Inode: 5474587501261011477 Links: 2
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2024-04-24 20:06:22.015736248 +0200
Modify: 2024-04-24 20:06:22.015736248 +0200
Change: 2024-04-24 20:06:22.015736248 +0200
Birth: -

1 Like