linux - nohup script stopped after some time
问题描述
I have a monitoring script running on my server which looks like
#!/bin/sh
tail -F /data/logs.txt | grep -E --line-buffered -io 'keyword1|keyword2' | while read -r line ; do
case "$line" in
"keyword1")
echo "hi"
;;
"keyword2")
echo "hi1"
;;
*)
esac
done
i have used -F in tail because if the new log file created it should follow the new file
I have ran that script in nohup to run indefinetly like below
nohup ./script.sh &
But the script getting stopped after a period of time
can someone help why it's happening ?
Thanks,
解决方案
推荐阅读
- javascript - 反应收集器 - 让用户在嵌入中发布
- java - 使用 Cucumber、Jmeter 和 FailSafe 的自动化框架是否需要 ThreadLocal?
- c++ - 由于#if,Visual Studio Code 智能感知无法识别部分头文件
- python - 如何根据python中的类别改进文件行数计数行
- android - 如何在 Android AccessibilityService 中查找状态栏、导航栏和屏幕的尺寸
- c - C中位的右循环
- pandas - pandas dayofyear 为期 2 年
- javascript - Uber 吃带滚动箭头的 Horizontal ScrollSpy
- swiftui - SwiftUI @EnvironmentObject:未找到?
- r - R C5.0决策树-“c50代码调用退出值为1”错误