利用cron监视后台进程状态(二)
2017-08-23 13:41
393 查看
第二种方案:更改系统级的crontab
1. 命令行输入:$sudo vim /etc/crontab
最后一行添加:* * * * * root bash /home/test/wanda_img_store/backends/bin/cron_worker.sh ,记得一定要添加user:root,否则不生效!
2. 需要crontab需要重载刚才的文件;命令行输入:$sudo service cron reload/restart
3. 查看更改的是否生效,$sudo crontab -l
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
相关文章推荐
- 利用cron监视后台进程状态(一)
- 利用cron监视后台进程状态
- 利用 AttachThreadInput 改变其它进程的输入法状态
- VB 利用WMI进行进程监视
- 利用Supervisor进行进程状态监控和报警
- ring3下利用WMI监视进程创建(vc版)
- Android 利用广播机制来进行SERVICE后台服务进程的守护
- 利用无障碍服务(AccessibilityService)批量清理后台进程
- Shell脚本之监视指定进程的运行状态
- C# 使用progressbar演示后台进程当前状态
- Linux 技巧:让进程在后台可靠运行的几种方法 用 cron 和 at 调度作业 使用 screen 管理你的远程会话
- ring3下利用WMI监视进程创建(vc版)
- 利用勾子监视系统或进程中的各种事件消息,截获发往目标窗口的消息并进行处理
- iOS并发编程笔记,包含GCD,Operation Queues,Run Loops,如何在后台绘制UI,后台I/O处理,最佳安全实践避免互斥锁死锁优先级反转等,以及如何使用GCD监视进程文件文件夹,并发测试的方案等
- 利用 AttachThreadInput 改变其它进程的输入法状态
- Shell脚本之监视指定进程的执行状态
- 利用ActivityLifecycleCallbacks实现前后台进程切换
- GCD,Operation Queues,Run Loops,如何在后台绘制UI,后台I/O处理,最佳安全实践避免互斥锁死锁优先级反转等,以及如何使用GCD监视进程文件文件夹,并发测试的方案等
- 监视某进程,保持进程处于启动状态(非正常退出后能自动启动)
- 利用ps指令查看某个程序的进程状态