I am trying to use rsync
(on macOS Catalina) but have trouble with spaces in file path names. I have used -s
or --protect-args
but they do not do anything (when I look at the help for rsync, these options are not listed).
I am running rsync
2.6.9 in zsh
. Can anyone help please?
Here is what I get when I run this rsync command:
chris@cgimac ~ % rsync -ahv /Volumes/G_5TB_general/Backup of CG-nas/mac drives/Fitness and health /Volumes/G_5TB_general/temp dump
building file list ...
rsync: link_stat "/Volumes/G_5TB_general/Backup" failed: No such file or directory (2)
rsync: link_stat "/Users/chris/of" failed: No such file or directory (2)
rsync: link_stat "/Users/chris/CG-nas/mac" failed: No such file or directory (2)
rsync: link_stat "/Users/chris/drives/Fitness" failed: No such file or directory (2)
rsync: link_stat "/Users/chris/and" failed: No such file or directory (2)
rsync: link_stat "/Users/chris/health" failed: No such file or directory (2) done
I get the exact same result if I modify the command to
rsync -ahv ‘/Volumes/G_5TB_general/Backup of CG-nas/mac drives/Fitness and health’ ‘/Volumes/G_5TB_general/temp dump’
I have looked elsewhere and there are many examples eg st
https://www.cyberciti.biz/faq/rsync-transfer-filename-that-contains-whitespace/
where the -s (or --protect-args) option for rsync apparently work.
rsync
command you are running (including arguments) and the eror messages you get?-s
(Mojave at least), but-S
. Also, no--protect-args
either. Also, for spaces in file path, escape character works. Also, many commands accept strings contained in quotes.