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…
opened 09:31AM - 27 Oct 20 UTC
category: backup
state: need investigating
I run my backups from a ZFS snapshot in order to ensure the entire file-system i… s in a consistent state. After I upgraded to restic 0.10.0 from the previous official release, the backup started adding a duplicate copy of all the directory meta-data while claiming that all the directories have been changed. For example (pardon my bash):
# restic version
restic 0.10.0 compiled with go1.15.2 on freebsd/amd64
# commands executed for bug (repeatedly on unchanging
# /usr/local/bin/restic backup -H $HOSTNAME --verbose=1 --cache-dir=$RESTIC_CACHE --exclude-file "${path}/${EXCLUDE_NAME}" "$path"
scan finished in 2.928s: 1604 files, 341.787 GiB
Files: 0 new, 0 changed, 1604 unmodified
Dirs: 0 new, 231 changed, 0 unmodified
Data Blobs: 0 new
Tree Blobs: 219 new
Added to the repo: 17.876 MiB
The result occurs repeatedly after re-running the backup on a new ZFS snapshot of an otherwise static file-system. I expect it to work like the previous version in which directories were not seen to be "changed".
I tested this on the same file-system except without using a ZFS snapshot, and it does not report directories as "changed" or upload duplicate metadata. Therefore, this problem seems to be particular to using ZFS snapshots. My method for backing up from ZFS snapshots is as follows:
* create ZFS snapshot of file-system labeled "restic"
* run backup of "$basedir/.zfs/snapshot/restic", where the snapshot is mounted
* destroy the ZFS snapshot labeled "restic"
I find it interesting that restic is uploading new/unique directory meta-data with every run, suggesting that something about the directory meta-data is actually changing between runs. However, earlier versions of restic did not "see" these changes. I'm at a loss as to what's causing this.
In terms of severity, this is merely a nuisance to me---about 30ish MiBs added to the repo each day. However, I could see this being a bigger problem on systems with a lot more small files. Is there any way I can find out what aspect of the directory is being identified as "changed" from the command-line? Adding verbosity did not appear to do the trick.
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
kapitainsky:
Very positive. …
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