rsync data replication kinmax

11
Simple Data Replication with RSYNC Windows <-> Linux Last update: December 27, 2005 מҽԖज़Ϧљ Sherman Chen Tel : 03-6562709 Ext. 751 e-Mail : [email protected] Hotline : 0800-kinmax

Upload: tiger-wen4061

Post on 26-Dec-2015

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Rsync Data Replication Kinmax

Simple Data Replication

with RSYNC

Windows <-> Linux

Last update: December 27, 2005

Sherman ChenTel : 03-6562709 Ext. 751

e-Mail : [email protected]

Hotline : 0800-kinmax

Page 2: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 2 of 11

Contents

1 Summary ........................................................................................................... 31.1 Conclusions............................................................................................................... 4

2 SSH without asking password ........................................................................ 42.1 Create id_dsa key in Windows Client (without Cygwin) ............................................. 4

2.2 Create id_dsa key in Windows Client (with Cygwin) .................................................. 5

3 Rsync: Server/Linux, Client/Windows ............................................................ 63.1 Windows Client (without cygwin) ............................................................................... 6

3.1.1 Create BACKUP batch file......................................................................................... 6

3.1.2 Schedule Jobs........................................................................................................... 6

3.2 Windows Client (with cygwin) .................................................................................... 6

3.2.1 crontab...................................................................................................................... 7

3.3 Lunix Client ............................................................................................................... 7

4 Rsync: Server/Windows, Client/Windows...................................................... 74.1 Install cwRsync Server .............................................................................................. 7

4.1.1 Error messages......................................................................................................... 8

5 rsync samples .................................................................................................. 95.1 List Server's Directory ............................................................................................... 9

5.2 crontab...................................................................................................................... 9

5.3 rsync parameters ...................................................................................................... 9

6 Chinese Filenames in Samba Server .............................................................. 96.1 Samba Server: Code: uft-8........................................................................................ 9

6.2 Samba Server: Code: big-5 ..................................................................................... 10

Page 3: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 3 of 11

1 Summary data

Rsync Server Backup Serverrsync service

Rsync Client Backup Client Windows " " Unixcrontab LinuxServer

id_dsa.pub Rsync Server ($HOME/.ssh/authorized_keys2)rsync Rsync Server

rsync <OPTIONS> <SOURCE> <DESTINATION>

Page 4: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 4 of 11

1.1 Conclusions1 rsync password id_dsa.pub

=> authorized_keys2 --password-fileRSYNC_PASSWORD

2 Rsync Client $HOME/.ssh/id_dsaRsync Server rsync -e "ssh -i /tmp/id_dsa"

3 Windows Server NT permission $HOME/cygdrive/c/Document and Settings/ ssh

2 SSH without asking password

2.1 Create id_dsa key in Windows Client (without Cygwin)cwRsync Client

WindowsClient

WindowsClient

LinuxServerLinuxServer ( ssh )

Page 5: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 5 of 11

WindowsClient

2.2 Create id_dsa key in Windows Client (with Cygwin) WinXP ( > ( ) > > > )

path c:\cygwin\binCYGWIN=ntsec tty

Page 6: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 6 of 11

3 Rsync: Server/Linux, Client/Windows

3.1 Windows Client (without cygwin)cwRsync Client (http://www.itefix.no/)

3.1.1 Create BACKUP batch file

3.1.2 Schedule Jobs - -

3.2 Windows Client (with cygwin)http://freebsd.ntut.idv.tw/document/cygwin_sshd_cron.html

WinXP Cygwin ssh 1. Cygwin OpenSSH cygrunsrv

Page 7: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 7 of 11

WinXP cron

$cygrunsrv -I cron -p /usr/sbin/cron -a -D$cygrunsrv -S cron

3.2.1 crontab

3.3 Lunix Clientrsync + cron

4 Rsync: Server/Windows, Client/Windowsmkpasswd -d ( $USER_HOME

/cygdrive/c/Documents and Settings/ cwRsync /home) /etc/passwd

$HOME $HOME/.ssh .sshRsync Client id_dsa key

4.1 Install cwRsync ServercwRsync Server (http://www.itefix.no/)

OpenSSH Server

Page 8: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 8 of 11

Openssh rsync server

bash

( service )

4.1.1 Error messagesAlways ask password

home directory Permission denied

NT permissionDocuments and Settings password

/home ( )

Page 9: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 9 of 11

/etc/passwd socket failed

5 rsync samples

5.1 List Server's Directory

5.2 crontab

5.3 rsync parameters--verbose--copy-links

-a --archive-r --recursive-l --links-p --perms-t --times-g --group-o --owner-D --devices-H --hard-links

-e --rsh=COMMAND--delete ’

6 Chinese Filenames in Samba Server

6.1 Samba Server: Code: uft-8Samba Server utf-8 Windos Big5

( ) telnet/ftp samba server

Read fromsocket failed: Connection reset by peer

SID

Page 10: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 10 of 11

telnet /ftp

locale

tool ( big-5 Utf-8) convmv ( perl) Samba server

(ftp )

�� ��

samba

6.2 Samba Server: Code: big-5Samba Server big-5

smb.conf big5

Page 11: Rsync Data Replication Kinmax

Linux NFS Cluster + EVA3000

Page 11 of 11