INOTIFY 系列(一) 安装 和初步使用
2016-03-31 00:00
357 查看
摘要: INOTIFY ,LINUX 文件监控
题记: 最近需要监控linux下某个目录下的文件变化,网友推荐了inotify.
目录
一 环境
系统环境
软件环境
二 安装
安装前检查
2.源码安装
三 验证
正文
一.环境
1.系统环境
CENTOS 6.6 内核 2.6.32
2. 软件环境
inotify-tools-3.14
下载地址:https://github.com/rvoicilas/inotify-tools/wiki
二 安装
2.1 安装前检查
据说内核版本 必须 大于等于 2.6.13 (笔者 未验证内核版本小于2.6.13,也未找到官方资料 ,所以是据说)
2. 源码安装
三验证
3.1 报错 inotifywait: error while loading shared libraries: libinotifytools.so.0: cannot open shared object file: No such file or directory
解决: 执行ldconfig
参考资料:
https://github.com/rvoicilas/inotify-tools/wiki http://www.ibm.com/developerworks/cn/linux/l-ubuntu-inotify/index.html
http://blog.csdn.net/wangxin6722513/article/details/44218893
http://www.infoq.com/articles/inotify-linux-file-system-event-monitoring
题记: 最近需要监控linux下某个目录下的文件变化,网友推荐了inotify.
目录
一 环境
系统环境
软件环境
二 安装
安装前检查
2.源码安装
三 验证
正文
一.环境
1.系统环境
CENTOS 6.6 内核 2.6.32
[root@scripts-1 usr]# lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.6 (Final) Release: 6.6 Codename: Final
[root@scripts-1 usr]# cat /proc/version Linux version 2.6.32-504.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15 04:27:16 UTC 2014 [root@scripts-1 usr]#
2. 软件环境
inotify-tools-3.14
下载地址:https://github.com/rvoicilas/inotify-tools/wiki
二 安装
2.1 安装前检查
据说内核版本 必须 大于等于 2.6.13 (笔者 未验证内核版本小于2.6.13,也未找到官方资料 ,所以是据说)
2. 源码安装
tar -zxvf inotify-tools-3.14.tar.gz cd inotify-tools-3.14 ll ./configure --prefix=/usr make make install
三验证
3.1 报错 inotifywait: error while loading shared libraries: libinotifytools.so.0: cannot open shared object file: No such file or directory
[root@scripts-2 inotify-tools-3.14]# inotifywait inotifywait: error while loading shared libraries: libinotifytools.so.0: cannot open shared object file: No such file or directory [root@scripts-2 inotify-tools-3.14]#
解决: 执行ldconfig
[root@scripts-2 inotify-tools-3.14]# inotifywait inotifywait: error while loading shared libraries: libinotifytools.so.0: cannot open shared object file: No such file or directory [root@scripts-2 inotify-tools-3.14]# ldconfig
[root@scripts-2 inotify-tools-3.14]# inotifywait
No files specified to watch!
[root@scripts-2 inotify-tools-3.14]#
参考资料:
https://github.com/rvoicilas/inotify-tools/wiki http://www.ibm.com/developerworks/cn/linux/l-ubuntu-inotify/index.html
http://blog.csdn.net/wangxin6722513/article/details/44218893
http://www.infoq.com/articles/inotify-linux-file-system-event-monitoring
相关文章推荐
- VPS下修改MySQL root用户密码的方法
- 更改Mysql root用户密码
- mysql误删root用户或者忘记root密码解决方法
- Mysql5.6 忘记root密码的解决办法
- MySql5.5忘记root密码怎么办
- Mysql忘记root密码怎么办
- 在ubuntu中重置mysql服务器root密码的方法
- MYSQL安装时解决要输入current root password的解决方法
- 强制修改mysql的root密码的六种方法分享(mysql忘记密码)
- 重置MySQL数据库root密码(linux/windows)
- 让PHP以ROOT权限执行系统命令的方法
- MYSQL 修改root密码命令小结
- Linux VPS利用SSH重置ROOT密码的方法
- Python中使用Inotify监控文件实例
- mysql误删root用户恢复方法
- Android无需root实现apk的静默安装
- MySQL5.1忘记root密码的解决办法(亲测)
- mysql修改密码的三方法和忘记root密码的解决方法
- mysql root用户的密码修改和消除
- apache的源码安装详细过程全纪录