經過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

相關文章
相關標籤/搜索