Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to back up users Chrome Sessions with Rsync with the following command:

rsync -e "ssh -i new.key" -r --verbose -tz --stats --progress --delete \
'/cygdrive/c/Users/jay/AppData/Local/Google/Chrome/User Data/Default/Current Session' \
user@host:"/chrome sessions/"

Except this doesn't work exactly, as I get a file called chrome in a sessions directory that is already present on the server.

Why is this?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You need to escape the space in "chrome sessions":

rsync -e "ssh -i new.key" -r --verbose -tz --stats --progress --delete '/cygdrive/c/Users/jay/AppData/Local/Google/Chrome/User Data/Default/Current Session' user@host:"/chrome\ sessions/"

The double quotes are parsed and stripped by the local shell, keeping the two words together as a single argument to rsync. Rsync connects to the remote host and spawns a new shell. That shell sees two arguments: "chrome" and "sessions". If you have a quoted string with an embedded escape, the escape survives the trip to your remote host and tells the shell to ignore the space.

share|improve this answer

try it like this:

rsync -r --verbose -tz --stats --progress --delete '/cygdrive/c/Users/jay/AppData/Local/Google/Chrome/User Data/Default/Current Session' -e "ssh -i new.key" user@host:"/chrome sessions/"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.