Sunday, May 24, 2009

rsync windows to linux

Scenario: windows has your user data and linux is your backup server.

1. compile cygwin... use the following, place them in your path
(c:\windows\system32 or c:\server\bin\)
rsync.exe
ssh.exe
ssh-keygen.exe
cygcrypto-0.9.8.dll
cygiconv-2.dll
cygintl-8.dll
cygminires.dll
cygpopt-0.dll
cygwin1.dll
cygz.dll

2. on the windows machine, run ssh-keygen at the command promptit will create a file
C:\Documents and Settings\user\.ssh\id_dsa.pub

3. copy C:\Documents and Settings\user\.ssh\id_dsa.pub to the linux machine... then authorize it:
mkdir ~/.ssh
cat id_dsa.pub >>~/.ssh/authorized_keys2
mkdir ~/backups

4. If you want to rsync F:\apps\myfolder then save the following as... backup.bat
-----------
F:
cd \apps
"c:\server\bin\rsync.exe" -arv -e "c:\server\bin\ssh.exe" myfolder user@linux:/home/user/backups/
-----------

No comments: