mirror of
https://github.com/xdtianyu/scripts.git
synced 2025-08-12 03:40:37 +08:00
Create cm_monitor.sh
This commit is contained in:
9
net/cm/cm_monitor.sh
Normal file
9
net/cm/cm_monitor.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# crontab: */1 * * * * /root/bin/cm_monitor.sh >> /tmp/cm_monitor.log 2>&1
|
||||||
|
|
||||||
|
if [ $(ps -ef|grep cm.py|grep -v grep|wc -l) -eq 0 ]; then
|
||||||
|
echo "$(date) -- cm.py is down, start again."
|
||||||
|
screen -dmS cm python3 /root/cm/cm.py
|
||||||
|
else
|
||||||
|
echo "$(date) -- cm.py is running."
|
||||||
|
fi
|
Reference in New Issue
Block a user