Streams of thought by...

This is the (tumble) log by Innerfusion, I'll post various things about code, design, politics, or whatever is interesting at the moment.

9/9/2009
10:51am
Go back home
Comments (View)

Running rsync with sudo

Rsync can probably be the best deployment tool (among other things) to use if you consider how fast and efficient it is. Lately however, I’ve run into issues on needing to rsync into directories that required sudo privileges, luckily google gave me a bit of help when figuring out how to do it.

Here is a version that simply sends sudo to the server and prepends rsync with sudo:

# run rsync with sudo
stty -echo; ssh you@hostname 'sudo -v'; stty echo
rsync -avz --rsync-path='sudo rsync' ~/location/on/your/computer you@hostname:~/location/on/server

You’ll obviously want to replace you@hostname and the location paths.

Fork the gist

Posted in: snippets rsync linux deployment

Notes

  1. innerfusion posted this