[CentOS] Rsync/SSH automation problem?

Thu Apr 30 22:57:00 UTC 2009
Les Mikesell <lesmikesell at gmail.com>

Gordon Messmer wrote:
> James Bensley wrote:
>> I have a win2k3 server that its backing up to a CentOS 5.3 server. On
>> the Win2k3 machine I plan to have rsync back up nightly to the CentOS
>> server through ssh. The command I am using is as follows:
>>
>> rsync -vrPtz -e ssh myuser at myserver:/remote/backup/folder/ /local/backup/folder/
> 
> The first thing I'm sure you noticed was that this syntax copies data 
> from a remote system to the local one, which is the opposite of what you 
> described doing, above.
> 
> The second thing you will notice, eventually, is that rsync over ssh 
> under Cygwin is unreliable.  This has been the case for years and has 
> something to do with Cygwin's emulation of blocking sockets which causes 
> rsync to hang.  Even if your backups are working now, I strongly 
> recommend against continuing in this manner.

You have always been able to initiate the command over ssh from a 
windows box with the answering copy under sshd on linux.  Very recent 
versions may even work the other way.

> If you want to use rsync on Windows, the best thing to do is run rsync 
> and ssh daemons on the Windows host.  Rsync should only listen for 
> localhost connections.  Run your backup jobs from Linux; ssh to the 
> Windows machine and forward a port for rsync.  A local rsync can then 
> connect to the Windows machine over the port forward.

Or, if you want it automated more nicely to keep a history of backups 
with a web interface to browse/restore them, look at backuppc. 
http://backuppc.sourceforge.net/  You can still use rsync as the copy 
mechanism if you want.

-- 
   Les Mikesell
    lesmikesell at gmail.com