Rsync安裝部署

2022-07-10 08:45:12 字數 3313 閱讀 2222

rsync  是一款開源的、快速的 多功能的 可以實現全量以及增量的本地或者是遠端的資料同步備份的優秀工具,並且可以不進行改變原有的資料屬性資訊,實現資料的備份和遷移的特性 ,rsync 軟體適用於 linux/unix/windows  等多種作業系統上 。

本地備份;

遠端備份;

無差異備份;

全量備份資料

增量備份資料

[root@pre2 ~]# rpm -qa | grep rsync

rsync-3.0.9-17.el7.x86_64

puppet-rsync-0.4.0-3.447685fgit.el7.noarch

[root@pre2 ~]# rsync --version

rsync version 3.0.9 protocol version 30

web site:

capabilities:

64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,

socketpairs, hardlinks, symlinks, ipv6, batchfiles, inplace,

rsync comes with absolutely no warranty. this is free software, and you

are welcome to redistribute it under certain conditions. see the gnu

general public licence for details.

cat >/etc/rsyncd.conf<#rsync_config

##rsyncd.conf start##

uid = rsync # 使用者 遠端的命令使用rsync訪問共享目錄

gid = rsync # 使用者組

use chroot = no # 安全相關

max connections = 200 # 最大連線數

timeout = 300 # 超時時間

pid file = /var/run/rsyncd.pid # 程序對應的程序號檔案

lock file = /var/run/rsyncd.lock # 鎖檔案

log file = /var/log/rsyncd.log # 日誌檔案

ignore errors # 忽略錯誤

read only = false # 可寫

list = false # 不能列表

hosts allow = 172.16.1.0/24 # 允許連線的伺服器

hosts deny = 0.0.0.0/32 # 後勤組連線的伺服器

auth users = rsync_backup # 虛擬使用者

secrets file = /etc/rsync.password # 虛擬使用者對應的使用者和密碼檔案

[backup] # 模組名稱

path = /backup # 服務端提供訪問的目錄

[root@pre2 ~]# mkdir -p backup                 #建立目錄

[root@rsync ~]# ls

backup install.log install.log.syslog optimize-init_sys.sh sysctl.conf

[root@pre2 ~]# useradd rsync -s /sbin/nologin -m #建立rsync備份目錄的管理使用者與使用者組

[root@pre ~]# chown -r rsync.rsync backup/ #授權

第二步;建立服務端和客戶端的身份認證檔案

[root@pre2 ~]# echo "rsync_backup:rsync123" >/etc/rsync.password

[root@pre2 ~]# chmod 600 /etc/rsync.password #配置檔案許可權只允許 root 使用者檢視

[root@pre2 ~]# cat /etc/rsync.password

rsync_backup:rsync123

啟動 rsync 服務

[root@pre2 ~]# rsync --daemon

[root@pre2 ~]# netstat -lntup |grep rsync

tcp6 0 0 :::873 :::* listen 14564/rsync

centos 預設以 xinetd 方式執行 rsync 服務。rsync 的 xinetd 配置檔案 在 /etc/xinetd.d/rsync。

要配置以 xinetd 執行的 rsync 服務需要執行如下的命令,也可以rsync --daemon 這樣獨立執行 。

# chkconfig rsync on

# service xinetd restart

[root@pre1 ~]# rpm -qa|grep rsync

rsync-3.0.9-17.el7.x86_64

puppet-rsync-0.4.0-3.447685fgit.el7.noarch

[root@pre1 ~]# echo "rsync123" >/etc/rsync.password

[root@pre1 ~]# cat /etc/rsync.password

rsync123

[root@pre1 ~]# chmod 600 /etc/rsync.password

[root@pre1 ~]# ls -ld /etc/rsync.password

-rw-r--r-- 1 root root 9 may 13 17:15 /etc/rsync.password

rsync安裝及部署

一。伺服器端 1.yum y install rsync xinetd 2.vi etc xinetd.d rsync 將yes 修改為no ipv6修改為ipv4 3.vi etc rsyncd.conf 新建檔案 uid root gid root use chroot no max conne...

windows下rsync部署安裝

2012 06 05 12 06 13 分類 系統 標籤 rsync windows 字型大小訂閱 rsync在windows與windows伺服器之間的同步設定 1.準備兩台機器 server 192.168.0.201 client 192.168.0.202 檔案 cwrsync client...

快速部署Rsync

環境拓撲 伺服器 192.168.1.10 客戶端 192.168.1.12 一 安裝rsync 伺服器 客戶端都需要安裝 tar zxvf rsync 3.0.8.tar.gz cd rsync 3.0.8 configure make make install 二 配置server vi etc...