This is a short one — I was using rsync to back up about a terabyte of data, which suffered a number of interruptions. Each time it restarted, I noticed it was copying over the same files over and over again. As it turns out, SMB rounds off the time stamps to the nearest two-second interval, so when rsync compares timestamps, it believes the file is different.
There’s a simple solution:
rsync -rlptDv –modify-window=1 [source] [destination]
The “–modify-window” switch tells rsync to relax its timestamp comparison just enough for it to behave.
The remaining switches are useful for backing up to a NAS box, it’s essentially -a (archive mode) expanded, but without preserving ownership or groups (which doesn’t work well on the NAS.)
Thanks for the help. This was causing me issues for an hour or so until I found this.
FYI that is a double-hyphen — before modify-window, it appears based on the font to be a single hyphen.
High-five! This is what i needed to go from my linux box to win2k3 server. Thanks a bunch.
When uploading this way from Linux to Win7 I had to drop the
-lpD
switches. Otherwise it just creates empty directories while reporting success. Still, thanks!