经过inotify实现监控文件并执行shell(shell编写实现)

#!/bin/bash
#监视目录和目标目录
FROM_DIR="/www/wwwroot/localhost.com/data.sql"sql

while true
do
inotifywait -mrq --timefmt '%d/%m/%y-%H:%M' --format '%T%w%f' -e modify $FROM_DIR | while read eventName dirName fileName; do
echo $eventName >> dbimport.log
sh /root/dbimport.sh
done
donebash

相关文章
相关标签/搜索