Rsync Service configuration Process
Rsync Daemon Service Deployment process:
#第一步: Check if software services are installed
[Email protected] ~]# Rpm-qa|grep rsync
Rsync-3.0.6-12.el6.x86_64
If the Rsync software does not exist
Yum Install-y rsync
#第二步: Writing the rsync configuration file/etc/rsyncd.conf
Rsyncd.conf is the Rsync service default profile, but it does not exist by default
Vim/etc/rsyncd.conf
#rsync_config
#created by HQ at #配置文件描述
# #rsyncd. conf start##
UID = rsync #用户, the remote command uses rsync to access the shared directory
GID = rsync #用户组
Use chroot = no #安全相关
Max connections = #最大连接数
Timeout = #超时时间
PID file =/var/run/rsyncd.pid #进程对应的进程号文件
Lock file =/var/run/rsync.lock #锁文件
Log file =/var/log/rsyncd.log #日志文件, display error message, etc.
Ignore Errors #忽略错误程序
Read Only = False #是否只读
List = False #是否可以列表
Hosts allow = 172.16.1.0/24 #运行访问rsync服务器的主机范围 (Whitelist
Hosts deny = 0.0.0.0/32 #禁止访问rsync服务器的主机范围 (blacklist)
Auth users = Rsync_backup #不存在的用户, only for authentication
Secrets file =/etc/rsync.password #不存在的用户进行认证时的密钥文件
[Backup] #模块名称
Comment = "Backup dir by Oldboy"
Path =/backup #模块对应的路径
#第三步: Creating a backup directory administrative user
Useradd-s/sbin/nologin-m rsync
#第四步: Create an authenticated user password file
echo "Rsync_backup:oldboy123" >/etc/rsync.password
chmod 600/etc/rsync.password
#第五步: Create a backup directory and authorize
Mkdir/backup
Chown-r rsync.rsync/backup/
Sixth step: Start the Rsync daemon service and view
Rsync--daemon
Ps-ef |grep rsync
Client deployment tests:
Interactive:
[Email protected] tmp]# rsync-avz/etc/services [email protected]::backup
Password:
Sending incremental file list
Sent bytes received 8 bytes 8.22 bytes/sec
Total size was 641020 speedup is 17324.86
Non-interactive:
echo "Oldboy123" >/etc/rsync.password
chmod 600/etc/rsync.password
rsync-avzp/etc/sysconfig/network [Email Protected]::backup--password-
File=/etc/rsync.password
Rsync service configuration Process-Daemon