安装:
[root@nfs01~]#yum install epel-release -y #<==安装epel源,默认的官方源没有inotify-tools工具包. (wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo) [root@nfs01~]#yum install inotify-tools -y#<==下载inotify软件工具inotifywait 命令参数:
常用监控文件事件功能参数:
inotify工具命令格式 inotifywait 命令语法格式示意图: 举例:
inotifywait -mrq -timefmt 'd/%m/%y %H:%M' --format '%T%w%f' -e create /data 监控/data目录create状态,处于阻塞状态,可以开两个窗口,一个监视,一个创建。参照:https://blog.51cto.com/wsxxsl/1767071 sersync文件放置路径: 编辑confxml.xml文件: 运行服务:
/application/sersync/bin/sersync -d -n 10 -o /application/sersync/conf/confxml.xml