2010年1月7日 星期四

Sync File with Rsync between Windows and Arch Linux

1. install rsync on both sides

windows version of rsync is called cwRsync, can be download from http://www.itefix.no/i2/node/10650

2. add each module with the below format to /etc/rsyncd.conf on linux server side

[share]
# comment = Private Share
path = /home/share
# read only = yes
# list = yes
# hosts allow = 192.168.1.0/24
uid = nobody
gid = nobody
# auth users = username
# secrets file = /etc/rsyncd.secrets

3. auth users is read from secrets file

vi /etc/rsyncd.secrets
--

username:password

4. start rsync daemon

/etc/rc.d/rsyncd start

5. test client connection

"C:\Program Files\cwRsync\bin\rsync.exe" username@source_ip::share

6. start synchronizing command from windows client side

"C:\Program Files\cwRsync\bin\rsync.exe" -rt --delete source_ip::share /cygdrive/c/destination

-a, --archive # archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive # recurse into directories
-t, --times # preserve modification times
--delete #delete extraneous files from destination dirs

/cygdrive/c/destination is the destination format for cwrsync

沒有留言: