inotify监视文件状态改变
时间:2010-03-10 来源:heidern
[root@Centos-1 tmp]# rpm -qa|grep inotify
inotify-tools-3.13-1.el5.rf exam : 监视sshd的登录情况 #!/bin/bash
while inotifywait -qq -e modify /var/log/secure
do
MSG=`tail -n1 /var/log/secure | grep sshd`
if [ -n "$MSG" ] ; then
echo "Somebody ssh to me!"
echo $MSG
fi
done
inotify-tools-3.13-1.el5.rf exam : 监视sshd的登录情况 #!/bin/bash
while inotifywait -qq -e modify /var/log/secure
do
MSG=`tail -n1 /var/log/secure | grep sshd`
if [ -n "$MSG" ] ; then
echo "Somebody ssh to me!"
echo $MSG
fi
done
相关阅读 更多 +