Hi, I’m new to restic and when I do backups I always get that two directories are changed.
I’m trying to backup files that are in my iCloud folder on macOS 14.5 Sonoma with restic 0.16.4 compiled with go1.21.6 on darwin/arm64. File system is APFS
With the verbose output I see that the directories /Users/toor and /Users are marked as modified.
[... more unchanged output ... ]
unchanged /Users/toor/Library/Mobile Documents/com~apple~CloudDocs/_main/screenshots/
unchanged /Users/toor/Library/Mobile Documents/com~apple~CloudDocs/_main/
unchanged /Users/toor/Library/Mobile Documents/com~apple~CloudDocs/
unchanged /Users/toor/Library/Mobile Documents/
unchanged /Users/toor/Library/
modified /Users/toor/, saved in 0.471s (0 B added, 0 B stored, 0 B metadata)
modified /Users/, saved in 0.472s (0 B added, 0 B stored, 300 B metadata)
Files: 0 new, 0 changed, 12726 unmodified
Dirs: 0 new, 2 changed, 2533 unmodified
Data Blobs: 0 new
Tree Blobs: 2 new
Added to the repository: 745 B (600 B stored)
processed 12726 files, 6.855 GiB in 0:01
snapshot de99faf7 saved
I tried with --ignore-ctime and --ignore-inode which also always shows the 2 modified directories. It happens, even if I immediately execute the backup after the last one is finished.
In the example above, your /Users/ dir had 300 bytes of metadata changed since the last snapshot, hence the message.
Your /Users/ folder on MacOS (and most other OSs) which houses your homedir is subject to constant accesses; every few seconds is the norm. The mere fact you have run a restic command as a user in that folder will cause changes to files / metadata in that folder.
So, to be expected.
Is this causing a particular issue with your backups?
thanks for your reply. I’d like to set up a cron job that runs every 2 hours and this would generate a snapshot regardless of changes. I’d like to only have a snapshot when there are changes, even if this isn’t necessarily relevant on a technical level.
I was hoping there was an option to ignore folder changes down the path that aren’t relevant for the backup.
Something about those folders seems to change. Please provide the output of the following command for two snapshots, replace $snapshotId with the actual ID of the snapshots: restic cat tree $snapshotId:/
Additional info: Just to outrule that it’s caused by the data of my real repository I did another test with one file that is also in /Users where I see the same behavior
Hmm, the atime, mtime and ctime are different between both snapshots, with the additional oddity that all three times are identical. Seems like some macOS magic is going on.
If I’m not mistaken, then actual home partition is mounted at /System/Volumes/Data/home do you also see that weird timestamp behavior when backing up that path?
Sorry, the path I meant was /System/Volumes/Data/Users. AFAIK the folders in /Users are actually stored on /System/Volumes/Data/Users as the root partition is not writable on macOS.