LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 784|回复: 2

[求助] 系统进程管理的脚本

[复制链接]
发表于 2006-8-16 10:17:45 | 显示全部楼层 |阅读模式
要完成这样一个任务
编写一个脚本,然后定时运行,检查指定的一些进程名是否运行,没有运行启动该进程

我刚学shell,不知道完成这个任务需要什么方面的shell知识
现在在看那本Advanced Bash Script Programming,但是经理只给我2周的时间,那本书有600页,就算看完了也囫囵吞枣了,所以像问一下具体要用到哪方面的知识

要完成这个任务,字符串上的处理要学习哪部分的知识,还需要别的什么东西?

如果,大侠们愿意给我一个示范的作参考,那就非常感谢
发表于 2006-8-16 11:26:15 | 显示全部楼层
It could be a very easy script. but not only you need to know shell programming, but also cron - the job/task scheduler, which is where you will put your script in. Do a man page on cron and you will see some details how to use it. For the script, you need to know:
1. ps command.
2. basic concepts of globbing or regex (regular expression) which will serve for searching patterns. (cmd related are such as grep, egrep, etc.)
3. You also might want to take a look variable substitution and commmand substitution.
4. For those processes you want to watch, you'd look at how to start them.
5. If you have some more time, then take a look the logging and debugging skills.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-16 11:44:18 | 显示全部楼层
谢谢,那我下午看一下正则规则和globbing
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表