天天看點

linux windows檔案同步

由于工作需要将Windows2003的檔案同步到Linux系統中,這裡我将具體配置記錄下來;

這裡隻配置windows-->linux的檔案同步其實這裡說成複制更确切些;

1.在windows2003上面安裝cwrsync的伺服器端軟體

2.修改其配置文檔rsyncd.conf

use chroot = false

strict modes = false

hosts allow = *

log file = rsyncd.log

pid file = rsyncd.pid

#uid = root

#gid = root

# Module definitions

# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work

#

# [test]

# path = /cygdrive/c/work

# read only = false

# transfer logging = yes

[syncdata]

path = /cygdrive/e/lt5  同步的目錄為e盤的lt5檔案夾

read only = false

transfer logging = yes

#auth user = root

#secrets file = /cygdrive/e/rsyncd.secrets

3.在服務内将RsyncServer設定為自動

4.在linux伺服器内的配置

檢視是否安裝rsync用戶端工具

[root@finet210 ~]# yum list | grep rsync

rsync.i386                               2.6.8-3.1              installed  

在計劃任何内添加如下内容

crontab -e

0 */2 * * * rsync -vzrtopg --progress --delete [email protected]::syncdata /usr/local/www/htdocs/syncdata;

同步時間可以自己調整

有個重要的問題需設定,由于以上述方法同步後檔案權限全部改變了,所有需設定一個非常關鍵的配置如下

在原來crontab内添加一條指令

繼續閱讀