Posted in Howto Linux SSH Security

Securely synchronize a folder from a remote machine with SSH

February 13, 2007 - 2 comments

rsync -vaz -e ssh user@server.domain.be:/home/user/ /home/user/

Source : user@server.domain.be:/home/user/
Target : /home/user/

-a : archive mode, preserve owner/group and permissions
-v : verbose
-z : compress data during transfer
-e : the remote shell to use

Output :
receiving file list ... done
created directory /home/user
./
28403/
BEXX0014/
28403.xml
error.xml
.
sent 876 bytes received 1294165 bytes 2590082.00 bytes/sec
total size is 1644823 speedup is 1.27

Comments

The Adminblogger

February 14, 2007 - 1:00

Hi Sebastien,

i’ve been told recently that the ‘-e ssh’ switch isn’t necessary anymore since it’s the default for rsync from/to remote hosts.

if you have data to transfer which could be easily compressed (such as logfiles) you might want to add -z (for gzip compression).

Ciao,
Marcel.

The Adminblogger

February 14, 2007 - 1:01

Sorry for the -z dupe – didn’t see you mentioned it already :)

Leave Comment

Please consider visiting the partners below if you enjoyed this article :

If this post saved you time and money, please consider checking my Amazon wishlist.

Before submitting, some rules :
- Is your comment related to the article ?
- You're having a problem ? Have you checked Google, other howtos, docs, manpages ?
- You're still having the problem ? Have you raised log verbosity, checked traces, ran tcpdump ?
- Have you checked your configuratoin for typo ?
Unless your comment is providing additional info or respect the rules above, DON'T comment.
If you don't understand what you are doing, I urge you to read the documentation, I'm not your free Level 1 helpdesk guy.