joerg.maier@rz.uni-mannheim.de
2003-Oct-08 20:14 UTC
use rsync with filenames containing "-"
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hey there, when i try to sync two directories or files containing a "-" character in ther path, rsync fails: # /usr/bin/rsync --partial -rcvaLe "ssh -o UserKnownHostsFile=/dev/null -o \ StrictHostKeyChecking=no" --progress "user@server:/path/band - album/" "/path/" this gives an error like: rsync: on remote machine: -: unknown option every escaping like \- or \\- fails, too. Any help is appreciated. joerg maier GnuPG Key and Fingerprint : http://www.shove-it.de/meinweb/joergpubkey03 GnuPG Key : gpg --keyserver www.keyserver.net --recv-key 76ECD5A7 Hi I am a signature virus. Please copy me to your .signature file to help me spread. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) Comment: For info see http://quantumlab.net/pine_privacy_guard/ iD8DBQE/g+OgTYj8eXbs1acRAtFrAJ99Be5EprM20sIsW/3p5i1Gn9/NZQCglJiW 2YHqfUEJkGSx0DFQHYT/5yE=7mvh -----END PGP SIGNATURE-----
On Wed, 8 Oct 2003, <joerg.maier@rz.uni-mannheim.de> wrote:> > Hey there, > > when i try to sync two directories or files containing a "-" character > in ther path, rsync fails: > # /usr/bin/rsync --partial -rcvaLe "ssh -o UserKnownHostsFile=/dev/null -o \ > StrictHostKeyChecking=no" --progress "user@server:/path/band - album/" "/path/" > > this gives an error like: > rsync: on remote machine: -: unknown option > > every escaping like \- or \\- fails, too. Any help is appreciated. > joerg maierThe dash isn't your problem. It's the spaces. The command being sent to the remote isn't including the quotes and isn't escaping the spaces, so the "user@server:/path/band - album/" becomes three tokens, and the '-' by itself causes the error. Try substituting one of these (note single vs. double quotes): 'user@server:/path/band\ -\ album/' "user@server:/path/band\\ -\\ album/" 'user@server:"/path/band - album/"' "user@server:'/path/band - album/'" This might work, too: "user@server:/path/band\ -\ album/" But I'd go with the first one, above. Good luck. -- John Van Essen Univ of MN Alumnus <vanes002@umn.edu>
Reasonably Related Threads
- Support for UserKnownHostsFile tokens?
- Variable substitution in UserKnownHostsFile configuration option
- Host key verification (known_hosts) with ProxyJump/ProxyCommand
- Host key verification (known_hosts) with ProxyJump/ProxyCommand
- [Bug 2525] New: Please add an alias such as -o Insecure for -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no