RSync Question

I'm looking to migrate a bunch of stuff from one server to another - and I think rSync will be my best bet based upon what I'm reading.

A couple of questions before I proceed with it though:

1: Does rSync need to be installed on both servers due to the compression?  Or - is it fine if I just install it on the destination server and use that to fetch from the original server?  Kind of like:

rsync -avzhe ssh root@xxx.xxx.x.xxx:/var/www/ /localdestination/

Does that seem like a decent command to use - that will just grab everything in that directory/file permissions/etc?

2: Does rSync run in the background once it's launched from SSH - or do I need to keep the SSH terminal alive during the transfer?  I've used ncftp for stuff like this in the past - and there's a special flag you need to set to keep it running in the background.  Is rSync similar - or will it just go once you've set it going and I can close the terminal window?  There's about 3TB of data I'm transferring - and I'd hate to worry about keeping the connection alive the whole transfer.

Thanks!
LVL 2
erzoolanderAsked:
Who is Participating?
 
Kent WSr. Network / Systems AdminCommented:
IF you have rsa keys between the machines this will work.  Otherwise you will be prompted for a user / pass, in which case obviously sending to the background won't work.

If you have rsa keys between them, then yes, that will do what you are expecting.  

You have a trailing slash on both locations, so the contents of /var/www/ will be mirrored to /localdestination/ just as you are expecting.
If you did not have a trailing slash, it would create www under /localdestination
0
 
Kent WSr. Network / Systems AdminCommented:
You don't need rsync on both. You are piping through ssh.  You would only need rsyncd (daemon) if you were running an rsync server.   The compression is actually in the data stream in between the servers.

You can add a space and "&" to the end to send it to the background. If you are calling a script via cron, I've never had to do that.  I only add & when I want to sent a CLI Rsync to the background.
0
 
erzoolanderAuthor Commented:
So does my example command look decent to you then - just a plain :

rsync -avzhe ssh root@xxx.xxx.x.xxx:/var/www/ /localdestination/ &

(with an ampersand at the end?)

Will that copy everything from the www directory and place it in the /localdestination/ directory...or will it place a www directory inside of /localdestination/ as well?
0
 
erzoolanderAuthor Commented:
Gracias
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.