crontab 如果不存在则运行

来源:互联网 发布:小学生大数据分析 编辑:程序博客网 时间:2024/05/17 04:38

如果该进程不存在,那么运行,并且将时间写入到日志中。

*/30 7-20 * * * log=/tmp/crawl.log;echo `date -R` >> $log; pgrep -laf crawl_index.py | grep -v /bin/sh > /dev/null || python3.6 /htdocs/crawl/crawl_index.py >> $log 2>&1
阅读全文
0 0