信仰

猛图www.omeng.org

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

在chinaunix上问了很久没找到解决方案

自己动手丰衣足食

脚本如下

 #!/bin/bash
c=$(ps -ef|grep python |grep -v "grep"|wc -l)
if [ $c -lt 1 ]
then
  python /home/spider/spider.py &
fi

保存文件名为 xxx.sh

运行命令 :crontab -e

在 nano里面 添加

*/分钟 * * * * sh 文件的路径

ctrl+x

Y

回车

/etc/init.d/cron restart

posted on 2011-07-27 16:34  信仰123  阅读(214)  评论(0)    收藏  举报

猛图