後,我正在寫一些的監控程序像這樣的:如何重新啓動一個進程它死了
tail -f /var/log/router-home.log | while read line ; do
echo "$line" | egrep "MTF_SIP" | cut -b 28- | sed -u 's/#012/\n/g' \
| egrep "IPP-->Received Event|rvCCConnMdmNewDigitCB|rvCCCallHandleOutOfBandDTMF" \
| cut -d " " -f 15
done > /tmp/phone/status &
但每次logrotation走來它改變了/var/log/router-home.log
殺有一個以上的這個例程過程 我不能檢查它的狀態只是做一個ps -e|grep tail
如何監視此例程,並在它死亡時重新啓動它?
謝謝!這可以解決問題 –
@KasperJanMooijman - 不要忘記點擊最佳答案旁邊的複選標記。 – ghoti
感謝您通知我,我必須習慣這個網站 –