Create cm_monitor.sh

This commit is contained in:
tianyu 2016-01-06 14:48:31 +08:00
parent e89d6aaab5
commit 32b6228919
1 changed files with 9 additions and 0 deletions

9
net/cm/cm_monitor.sh Normal file
View 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