Created
January 1, 2015 13:53
-
-
Save dongyuwei/2739c809efce7d7ec80a to your computer and use it in GitHub Desktop.
cron job for nginx server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#crontab -u root -e | |
# m h dom mon dow command | |
#*/1 * * * * /bin/sh /opt/code/cron.sh > /dev/null 2>&1 | |
count=`ps -wef|grep sbin/nginx |grep -v grep |wc -l` | |
if [ "$count" -eq 1 ]; then | |
echo "The nginx process already run"; | |
else | |
echo "Start the nginx process now:" | |
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment