shell脚本实现定时重启进程

##############################Deploy crontab for yechang ad*******eta restart ########################
echo "start deploy crontab for yechang ad*********a restart"
#早上9点对ad********a进程进行重启操作
 
if [ $pac*******ver = 'yechang' ];then
     cp -r $PACKAGE_DIR/yechang_ad*******_restart.sh /data/sh/
     chmod +x /data/sh/*
 
    if [ `grep -v '^\s*#' /var/spool/cron/root |grep -c 'yechang_ad****8er'` -eq 0 ];then
           echo "0 9 * * * sh /data/sh/yechang_a*******restart.sh > /dev/null 2>&1" >> /var/spool/cron/root
 
    fi
fi

 

posted @ 2018-03-28 09:40  Oops!#  阅读(3536)  评论(0编辑  收藏  举报