美文网首页
监控文件可使用 inotifywait

监控文件可使用 inotifywait

作者: 9682f4e55d71 | 来源:发表于2017-04-27 15:15 被阅读17次
#!/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

相关文章

网友评论

      本文标题:监控文件可使用 inotifywait

      本文链接:https://www.haomeiwen.com/subject/aetnzttx.html