August 18, 2025Aug 18 rsync -a from macOS (15.5) to unRAID (7.1.4) over SMB resets modification time (as indicated by stat -f "%Sm") to current time.The share is array-only and the disks are XFS.Happens both with the pre-installed rsync v2.6.9 and later v3.4.1.Calling rsync with the --fsync option solves the problem.Posting here to see if I'm the only one affected before filing a bug report.
August 23, 2025Aug 23 Community Expert Solution Calling rsync form apple or rsync form unraid terminal?I assume a smb connection on the Apple device. as it’s not really a Unraid/XFS bug, it’s mostly about how macOS implements SMB + rsyncHere’s what’s going on:On macOS, rsync doesn’t talk to the filesystem directly when you’re writing to a remote SMB share — it’s writing through Apple’s SMB client.Apple’s SMB client is very aggressive with write caching and metadata updates. By default, when rsync finishes copying a file, the mtime (modification time) isn’t guaranteed to be flushed down to disk correctly.That’s why you see it reset to “now” on the Unraid side instead of being preserved.When you add --fsync, rsync tells the OS to explicitly flush each file’s data and metadata to disk before moving on. That forces macOS to commit the proper mtime, so you see the expected behavior in Unraid.Why this is Apple-specificOn Linux rsync over SMB/NFS/SSH, you generally don’t need --fsync.On macOS, Apple’s SMB stack often ignores utimes()/futimens() metadata updates until the file is fully closed and flushed. Without fsync, the SMB server (Unraid in this case) just gets “best-effort” timestamps.That’s why it doesn’t matter whether you use rsync 2.6.9 or 3.4.1 — the problem is lower in the stack (SMB + APFS caching behavior).some potential workarounds...If you want stable results without always remembering --fsync:rsync -a --fsync source/ /Volumes/UnraidShare/dest/Force rsync to go over SSH instead of SMBMount your Unraid share via SSH (or just run rsync directly over ssh://).That way rsync is talking directly to Unraid’s filesystem, bypassing Apple’s SMB client.rsync -a -e ssh source/ user@unraid:/mnt/user/share/Use --inplace in some workflows (can help with timestamp consistency if files are being updated instead of replaced).Check your Unraid SMB settingsSometimes forcing fruit:metadata=netatalk or disabling AAPL extensions in smb-extra.conf changes how timestamps are handled.But for your case, it seems squarely an rsync + macOS SMB caching thing.Rewrite unraids SMB: https://forums.unraid.net/topic/178033-bmartino1-user-scripts/#findComment-1478661 Edited August 23, 2025Aug 23 by bmartino1
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.