6

I use rsync to backup all the files from a specific folder in a USB drive connected to my Mac (Osx 10.9) to a folder of my home network NAS.
The problem is that rsync replace all files and it does not skip existing files. Where I'm wrong? I use rsync 3.0.9.

rsync -avzh --delete --progress --filter='-p .DS_Store' /Volumes/USBDrive/Foto/* /Volumes/Nas/Foto
HalosGhost
  • 4,790
SergioP
  • 161
  • 2
    You didn't pass an option to tell rsync to skip existing files, so why would it? Do you want to skip all files that exist in the destination, or only to skip files that already exist with the same content? If you only want to skip files with the same content, what filesystem does your NAS use? What does ls -l --full-time show for a sample file on both sides? – Gilles 'SO- stop being evil' Nov 07 '14 at 02:20
  • Related: https://unix.stackexchange.com/questions/67539/how-to-rsync-only-new-files – Ciro Santilli OurBigBook.com Nov 02 '19 at 18:18

2 Answers2

7

If want to skip files that exist without updating them, even if there are changes to those files, then use the --ignore-existing flag in your rsync command.

rsync --ignore-existing -avzh --delete --progress --filter='-p .DS_Store' /Volumes/USBDrive/Foto/* /Volumes/Nas/Foto

see https://explainshell.com

Phil
  • 103
3

Maybe the NAS is formatted in FAT? If so, you will need --modify-window=1 to accommodate the time stamp rounding. See this post for more explanation about this issue.

rsync --modify-window=1 -avzh --delete --progress --filter='-p .DS_Store' /Volumes/USBDrive/Foto/* /Volumes/Nas/Foto

tnagano
  • 31