自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

rsync從linux到linux的文件同步備份

運(yùn)維 系統(tǒng)運(yùn)維
需要備份文件的服務(wù)器(服務(wù)器端):192.168.1.201 (RHEL 5).接收備份文件的服務(wù)器(客戶端):192.168.1.202 (CENTOS 5)

一、環(huán)境
需要備份文件的服務(wù)器(服務(wù)器端):192.168.1.201 (RHEL 5)
接收備份文件的服務(wù)器(客戶端):192.168.1.202 (CENTOS 5)

二、安裝配置
1.服務(wù)器端的配置
A、采用系統(tǒng)默認(rèn)安裝的rsync 編輯/etc/rsyncd.conf文件,如果沒有則新建一個(gè)。
vi /etc/rsyncd.conf
#[globale]
strict modes= yes  #check passwd file
port= 873 #default port
logfile= /var/log/rsyncd.log
pidfile= /var/run/rsyncd.pid
max connections= 4
#[modules]
[testlink]   #備份模塊
uid= root
gid= root
path= /usr/local/apache/htdocs/testlink/upload_area  #要備份的目錄
read only= no
host allow= *
auth users= wwyhy
secrets file= /etc/rsyncd.scrt
[bugfree]         #備份模塊
uid= root
gid= root
path= /usr/local/apache/htdocs/bugfree/BugFile         #要備份的目錄
read only= no
host allow= *
auth users= wwyhy
secrets file= /etc/rsyncd.scrt
[redmine]   #備份模塊
uid= root
gid= root
path= /usr/local/redmine-0.8.1/files       #要備份的目錄
read only= no
host allow= *
auth users= wwyhy
secrets file= /etc/rsyncd.scrt

B、 添加一個(gè)密碼文件
vi /etc/rsyncd.scrt
內(nèi)容如下:
wwyhy:123456  #(自己設(shè)置)

C、改變權(quán)限為600
chmod 600 /etc/rsyncd.scrt

D、啟動(dòng)服務(wù)(如開有防火墻請(qǐng)?jiān)试S873端口通過(guò))
rsync --daemon --config=/etc/rsyncd.conf &

2.配置客戶端
客戶端我則自己編譯安裝的rsync-3.0.3.tar.gz的
A、安裝:
tar -zxvf rsync-3.0.3.tar.gz
cd rsync-3.0.3
./configure
make
make install
B、添加密碼文件
vi /etc/rsyncd.scrt (沒有就新建)
內(nèi)容如下:
wwyhy:123456 (文件與客戶端文件內(nèi)容一樣)
C、改文件權(quán)限為600
chmod 600 /etc/rsyncd.scrt

三、開始備份
可以在客戶端通過(guò)man rsync指令來(lái)查看備份指令
我們用腳本來(lái)自動(dòng)執(zhí)行備份
列:rsync -avz --password-file=密碼文件路徑 username@需要備份的主機(jī)IP::備份里的模塊名稱
接收備份文件的路徑
在/root建一個(gè)腳本文件
vi backup

添加內(nèi)容如下:
#1.192.168.1.201上的testlink附件備份指令
rsync -avz --password-file=/etc/rsyncd.scrt wwyhy@192.168.1.201::testlink
/home/wangwei/testlink/upload_area
#2.192.168.1.201上的bugfree附件備份指令
rsync -avz --password-file=/etc/rsyncd.scrt wwyhy@192.168.1.201::bugfree
/home/wangwei/bugfree/BugFile
#3.192.168.1.201上的redmine附件備份指令
rsync -avz --password-file=/etc/rsyncd.scrt wwyhy@192.168.1.201::redmine
/home/wangwei/redmine-0.8.1/files

chmod u+x backup

每晚2.30自動(dòng)執(zhí)行
vi /etc/crontab

30 2 * * * root /root/backup


 

【編輯推薦】

  1. 嵌入式系統(tǒng)Linux內(nèi)核開發(fā)實(shí)戰(zhàn)指南
  2. Linux設(shè)備驅(qū)動(dòng)開發(fā)詳解
  3. Linux系統(tǒng)***實(shí)踐工具:命令行技術(shù)
責(zé)任編輯:張燕妮 來(lái)源: 中國(guó)IT實(shí)驗(yàn)室
相關(guān)推薦

2017-03-01 12:19:17

rsync Linux系統(tǒng)

2009-11-30 10:05:28

Linuxrsync同步

2010-09-14 09:15:03

RsyncLinux備份遠(yuǎn)程數(shù)據(jù)同步

2021-06-18 10:28:56

Linuxrsync命令

2021-06-09 08:05:02

Linux 備份數(shù)據(jù)

2019-09-02 07:53:09

Linuxrsync服務(wù)器

2023-01-31 08:34:19

2012-02-29 00:49:06

Linux學(xué)習(xí)

2020-12-17 08:14:30

Linuxrsync備份

2017-06-29 09:28:37

OracleMariaDB復(fù)制

2013-12-18 13:30:19

Linux運(yùn)維Linux學(xué)習(xí)Linux入門

2011-10-09 09:26:04

ubuntursync服務(wù)器

2021-12-20 14:22:07

Linux打印文件

2013-09-16 16:20:55

自動(dòng)備份Dropbox

2010-11-22 09:36:37

Perl腳本SolarisLinux

2017-03-25 20:30:15

2018-09-19 12:08:04

Linux服務(wù)器數(shù)據(jù)

2020-09-24 08:45:10

React架構(gòu)源碼

2014-08-14 10:52:49

windowslinux

2009-09-29 10:52:34

Linux自動(dòng)備份操作系統(tǒng)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)