Skip to content

Instantly share code, notes, and snippets.

@StanAngeloff
Created September 1, 2014 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StanAngeloff/0919bf465c2be675b284 to your computer and use it in GitHub Desktop.
Save StanAngeloff/0919bf465c2be675b284 to your computer and use it in GitHub Desktop.
Copying modified files from a remote host in a path with spaces using rsync.
# Copying modified files from a remote host in a path with spaces using rsync.
# NOTE: spaces are double-escaped, e.g., '\\ '.
$ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null user@hostname -- find /remote/path\\ to\\ files/ -type f -ctime -365 -print0 | \
rsync -avz --progress -e "ssh -C -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" -0 --files-from=- user@hostname:/ ./local/path/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment