Skip to content

Commit

Permalink
每分钟检测gofound运行脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
ep1088 committed Aug 22, 2022
1 parent 644d652 commit bcc2845
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gofound.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

#每分钟检测gofound运行
#*/1 * * * * /data/gofound/gofound.sh > /dev/null 2>&1

count=`ps -fe |grep "gofound"|grep "config.yaml" -c`

echo $count
if [ $count -lt 1 ]; then
echo "restart"
echo $(date +%Y-%m-%d_%H:%M:%S) >/data/gofound/restart.log
/etc/init.d/gofound.d restart
else
echo "is running"
fi

0 comments on commit bcc2845

Please sign in to comment.