#!/bin/bash if [ "`pgrep test | wc -l`" == "0" ]; then echo "`date ‘+%F %T‘`:[test]停止运行" >> /var/log/crontab/crontab.log systemctl restart test fi
* * * * * . /home/lee/test.sh
centos7使用crontab监测服务器的运行情况
原文:http://blog.51cto.com/12173069/2155513