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
2
  • 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? Commented Nov 7, 2014 at 2:20
  • Related: unix.stackexchange.com/questions/67539/… Commented Nov 2, 2019 at 18:18

2 Answers 2

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

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

1
  • This is some nice niche info. Commented Mar 1, 2022 at 23:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .