0

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?

2 Answers 2

2

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.

-1

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/"

You must log in to answer this question.

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