inotify事件监控

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了inotify事件监控相关的知识,希望对你有一定的参考价值。

1、第一个里程碑
搭建好备份服务器,rsync服务
2、启动inotify
1)配置epel源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
2)检查inotify-tools是否安装
rpm -qa inotify-tools
安装
yum install -y inotify-tools

3)编写inotify实时监控脚本
vim inotify.sh
#!/bin/sh
/usr/bin/inotifywait -mrq -e create,delete,close_write /data|
while read line
do
rsync -avz --delete /data/ [email protected]::backup --password-f ile=/etc/rsync.password
done
4)放入后台运行
sh inotify &

以上是关于inotify事件监控的主要内容,如果未能解决你的问题,请参考以下文章

inotify事件监控

inotify机制监控文件系统事件原理及使用

inotify高效监控Linux文件系统事件

Linux系统——Inotify事件监控工具

linux 实时同步inotify

通过inotify实现反调试