How to rsync over ssh when directory names have spaces – Unix & Linux Stack Exchange

This works in bash: Escape the spaces with backslash and then use quotes:

rsync -avuz me@some.server.com:"/media/Music/Heavy\ Metal/Witch\ Mountain/*" .

Or if you have the path in the variable $remote_path, spaces can be escaped with substitution:

rsync -avuz me@some.server.com:"${remote_path// /\\ }" .

Source: How to rsync over ssh when directory names have spaces – Unix & Linux Stack Exchange

How to rsync over ssh when directory names have spaces – Unix & Linux Stack Exchange was last modified: July 5th, 2020 by Jovan Stosic

Leave a Reply