你的位置:首页 > 软件开发 > 操作系统 > linux 守护程序小记(指定进程不存在则启动 )

linux 守护程序小记(指定进程不存在则启动 )

发布时间:2015-07-30 16:00:06
最近想在debian 下做个守护进程.用于守护指定的程序一直处于运行状态.网上查了下,有Crontab方式和写脚本执行方式.  Crontab  Crontab 是系统自带的,类似于Windows的计划任务.相关介绍与使用可以查看:  "Debian的定时执行命令Cro ...

 

最近想在debian 下做个守护进程.用于守护指定的程序一直处于运行状态.网上查了下,有Crontab方式和写脚本执行方式.

  

Crontab

  Crontab 是系统自带的,类似于Windows的计划任务.相关介绍与使用可以查看:

  "

Debian的定时执行命令Crontab:http://www.tdblog.cn/?post=276

nano /etc/crontab #编辑配置后

root@:~# cat /etc/crontab # /etc/crontab: system-wide crontab# Unlike any other crontab you don't have to run the `crontab'# command to install the new version when you edit this file# and files in /etc/cron.d. These files also have username fields,# that none of the other crontabs do.SHELL=/bin/shPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin# m h dom mon dow user command17 *  * * *  root  cd / && run-parts --report /etc/cron.hourly25 6  * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )47 6  * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )52 6  1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )##my server 3分钟执行一次*/3 * * * *  root  /bin/bash /abc/mysh/t2.sh

原标题:linux 守护程序小记(指定进程不存在则启动 )

关键词:linux

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录