[i=s] 本帖最后由 pirlo 于 2009-7-23 12:51 编辑 [/i]
我在/etc/cron.daily/下面放了一个脚本centosplus.sh,但是每天都没运行,何解?
**********************************************************************
[root@dns-cache cron.daily]# cat centosplus
#!/bin/bash
#centosplus
date >>/var/log/yum_update.log 2>&1
cd /opt/yum/centos/5.3/centosplus
lftp http://centos.ustc.edu.cn/centos/5.3/centosplus/ -e "mirror -e;bye" >>/var/log/yum_update.log 2>&1
#updates
cd /opt/yum/centos/5.3/updates
lftp http://centos.ustc.edu.cn/centos/5.3/updates/ -e "mirror -e;bye" >>/var/log/yum_update.log 2>&1
#extras
cd /opt/yum/centos/5.3/extras
lftp http://centos.ustc.edu.cn/centos/5.3/extras/ -e "mirror -e;bye" >>/var/log/yum_update.log 2>&1
#Base
cd /opt/yum/centos/5.3/os
lftp http://centos.ustc.edu.cn/centos/5.3/os/ -e "mirror -e;bye" >>/var/log/yum_update.log 2>&1
#Rpmforge
cd /opt/yum/centos/5.3/rpmforge/i386/rpmforge
lftp ftp-stud.fht-esslingen.de:/dag/redhat/el5/en/i386/rpmforge/ -e "mirror -e;bye" >>/var/log/yum_update.log 2>&1
*******************************************************************
以上是脚本的内容。
/var/log/yum_update.log里面没有任何出错的记录。
xiadao_81 于 2010-01-14 16:51:42发表:
遇见过同样问题!求解
luyao6600 于 2009-07-24 09:53:52发表:
坐等高手
jgq0031 于 2009-07-24 09:33:06发表:
看不懂.得再学习下.
pirlo 于 2009-07-24 09:13:54发表:
未解决。。。。顶起
pirlo 于 2009-07-23 13:19:00发表:
[i=s] 本帖最后由 pirlo 于 2009-7-23 13:23 编辑 [/i]
有的,因为我在crontab -e 里面也有计划任务在执行。
[root@dns-cache /]# crontab -l
0 10 * * 6 nice -n 15 /var/www/remove-backup.sh
[root@dns-cache /]# service crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
[root@dns-cache /]# ps -aux |grep crond
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 12938 0.0 0.0 5464 1108 ? Ss 13:13 0:00 crond
root 12954 0.0 0.0 4104 620 pts/2 S+ 13:17 0:00 grep crond
wjb711 于 2009-07-23 13:13:59发表:
ps -aux|grep cron
看看后台有没有跑cron
说不定cron计划任务根本没启动
pirlo 于 2009-07-23 12:40:49发表:
手动执行脚本没有问题。