您的当前位置:首页正文

监控文件可使用 inotifywait

来源:华拓网
#!/bin/bash
dir="${1}"
inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format  '%w%f' --event CLOSE_WRITE,delete --exclude '.svn'  $dir | while read file
do
    if [ "${file: -4}" != '4913' ]  && [ "${file: -1}" != '~' ]; then
        php /sync.php $file
    fi
done