加入收藏 | 设为首页 | 会员中心 | 我要投稿 威海站长网 (https://www.0631zz.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 系统 > 正文

windows上配置rsync服务器收集linux主机巡检报告

发布时间:2021-03-04 22:30:54 所属栏目:系统 来源:网络整理
导读:客户这里,有很多linux主机,都是centos7的,我们需要定期每天对linux主机进行巡检,然后把巡检结果集中保存,方便对主机状态检查。 为了巡检工作需要,需要在linux主机上编写巡检脚本,配置rsync客户端。、 linux巡检脚本 我收集了一个巡检脚本,如下所示:

右击目录,打开属性——安全,把安装rsyncd时,设置的帐号添加进来,并设置权限为完全控制(我安装rsyncd的时候,设置了帐号是rsync,密码123456):

windows上配置rsync服务器收集linux主机巡检报告

修改配置文件:

windows上配置rsync服务器收集linux主机巡检报告


打开G:linux_server_logICWrsyncd.conf
修改内容大致如下:

use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log

# Module definitions
# Remember cygwin naming conventions : c:work becomes /cygwin/c/work
#
[172.31.101.12]
path = /cygdrive/g/linux_server_log/172.31.101.12
read only = false
transfer logging = yes
auth users = rsync
secrets file = etc/rsyncd.secrets.txt
UID = 0
GID = 0

[172.31.101.24]
path = /cygdrive/g/linux_server_log/172.31.101.24
read only = false
transfer logging = yes
auth users = rsync
secrets file = etc/rsyncd.secrets.txt
UID = 0
GID = 0

[172.31.101.20]
path = /cygdrive/g/linux_server_log/172.31.101.20
read only = false
transfer logging = yes
auth users = rsync
secrets file = etc/rsyncd.secrets.txt
UID = 0
GID = 0

说明:
1、[172.31.101.12],[172.31.101.24]就是同步文件的目录,我这里以linux主机ip地址方式命名,方便区分,有多个客户端需要进行rsync同步的话就要配置中添加多个配置
2、注意path路径,path = /cygdrive/是固定的,不要改,后面连接的/g/linux_server_log/172.31.101.12,则是我们刚才所建的目录路径,刚才我是建在G盘的,g/linux_server_log/172.31.101.12

其他参数详解:
read only = true #客户端只读

list = no#不允许列出文件

hosts allow=192.168.0.141 #允许连接IP,多个IP中间用英文状态下逗号隔,不限制IP填写*即可

auth users =rsync #允许连接的用户名

secrets file = etc/rsyncd.secrets #存放用户名密码的认证文件路径
建rsync同步帐号密码文件:

(编辑:威海站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读