rsync to Windows Server NTFS share always copies all files/folders
I am using rsync to backup a folder on my Lubuntu 20.04 host to an NTFS share on a Windows 2022 Server. The command below always copies every file and folder, despite the fact that no changes have been made:
rsync -av "/var/www/" "/media/server2022/web"
I've tried the options below, but it made no difference:
rsync -av --modify-window=1 "/var/www/" "/media/server2022/web"
rsync -av --modify-window=2 "/var/www/" "/media/server2022/web"
Any ideas for how I can sync only new or modified files/folders?
Top Answer/Comment:
NTFS handles metadata like time stamps differently. The most common workaround I've seen (and that works for me but doesn't always seem to work for everybody) is to give the --size-only flag, which tells it to ignore timestamps and consider a file changed when its size changes. I.e.
rsync -v --size-only /var/www/ /media/server/pathStuff
(I removed the -a because that tries to preserve ownership and permissions and such which are handled completely differently in NTFS)
상단 광고의 [X] 버튼을 누르면 내용이 보입니다