linux监控记录文件状态改变

2014-02-08 14:00  2898人阅读  评论 (0)

简介

linux提供的新接口inotify可以很方便监控文件的状态改变,但是都是些C api,需要编程.开源人事提供了inotify-tools工具,可以使用命令方便的监控文件的状态改变.

inotify-tools监控例子

inotifywait --timefmt "%y-%m-%d %H:%M:%S" --format "%T,%w,%f,\"%e\"" -mqro /var/log/file.log /www/web/www.dotcoo.com/public_html

安装

http://sourceforge.net/projects/inotify-tools/

./configure
make
make install

https://github.com/rvoicilas/inotify-tools

./autogen.sh
autoconf
./configure
make
make install
豫ICP备09035262号-1