1

我已经运行了一个守护程序来监视特定目录的文件更改,一开始程序运行正常,但一段时间后,inotifywait 确实在文件更改时工作。当我重新启动程序时,它又恢复了正常。这是我的 shell 脚本:

#!/bin/sh
./etc/puppet/modules/config.sh
puppetmaster=`grep -w server ${puppet_config} | awk -F'=' '{print $2}'`
/usr/local/bin/inotifywait -mrq -e modify ${log_dir}|  while read D E F
do
    /usr/bin/rsync -i -p -H -S -z -r -A -o -g -a --port=${port} \
    --timeout=600 --exclude='.svn/' --exclude='.git/' ${log_dir}/ \
    rsync://${puppetmaster}/log_dir > /dev/null
done

请有人帮助我。谢谢..

4

0 回答 0