XY BLOG

XY的BLOG

shell 进程检测常驻

Published on in Posts
Updated on
Short link: https://b.xyzt07.cn/s/15
Share this post
A ⇄ 文
⚠️ This entry is already over one year old. It may no longer be up to date. Opinions may have changed.

ps |grep ffmpeg |grep -v grep if [ $? -ne 0 ] then

nohup /opt/bin/ffmpeg -rtsp_transport tcp -i rtsp://xxx:[email protected]:554 -vcodec copy -f segment -segment_time 1800 -segment_atclocktime 1 -strftime 1 “/tmp/mnt/media/video/%Y-%m-%d_%H-%M-%S_1.mp4” >/dev/null 2>&1 &

else echo “runing…” fi