利用cron监视后台进程状态(二)
来源:互联网 发布:医生收入 知乎 编辑:程序博客网 时间:2024/06/08 04:05
第二种方案:更改系统级的crontab
1. 命令行输入:$sudo vim /etc/crontab
最后一行添加:* * * * * root bash /home/test/wanda_img_store/backends/bin/cron_worker.sh ,记得一定要添加user:root,否则不生效!
1 # /etc/crontab: system-wide crontab 2 # Unlike any other crontab you don't have to run the `crontab' 3 # command to install the new version when you edit this file 4 # and files in /etc/cron.d. These files also have username fields, 5 # that none of the other crontabs do. 6 7 SHELL=/bin/sh 8 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 9 10 #m h dom mon dow user command 11 17 * * * * root cd / && run-parts --report /etc/cron.hourly 12 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 13 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 14 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) 15 * * * * * root bash /home/test/wanda_img_store/backends/bin/cron_worker.sh 16 #~ ~ ~ ~ ~ ~ ~
2. 需要crontab需要重载刚才的文件;命令行输入:$sudo service cron reload/restart
3. 查看更改的是否生效,$sudo crontab -l
阅读全文
0 0
- 利用cron监视后台进程状态(二)
- 利用cron监视后台进程状态(一)
- 利用信号监视进程存在
- Linux后台进程(cron和crontab)
- VB 利用WMI进行进程监视
- 如何利用cron进程来自动执行
- 后台进程二:DBWR进程
- Shell脚本之监视指定进程的运行状态
- 监视进程
- 进程监视
- ring3下利用WMI监视进程创建(vc版)
- ring3下利用WMI监视进程创建(vc版)
- 如何利用cron进程来自动执行(总结)
- 监视某进程,保持进程处于启动状态(非正常退出后能自动启动)
- 利用进程管理后台运行node
- 监视系统状态
- 监视java虚拟机状态
- 监视网卡状态
- web项目
- 26muduo_net库源码分析(二)
- ABAP Objects Design Patterns – Model View Controller (MVC) Part 1
- prim算法
- 去除二值图像的杂散点
- 利用cron监视后台进程状态(二)
- 算法题目——python基础巩固练习一 斐波那契数列
- Scala保留字
- 容器适配器
- Android之Kotlin实现补间动画-(TweenAnimaion)
- 今日头条2017内推
- 字典序
- ==和!= 返回的类型
- c++和java的内存管理,分别是怎么实现的,怎么防止内存泄露?