红联Linux门户
Linux帮助

计划任务问题(centos 5.3)

发布时间:2009-07-23 12:40:08来源:红联作者:pirlo
[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里面没有任何出错的记录。
文章评论

共有 7 条评论

  1. xiadao_81 于 2010-01-14 16:51:42发表:

    遇见过同样问题!求解

  2. luyao6600 于 2009-07-24 09:53:52发表:

    坐等高手

  3. jgq0031 于 2009-07-24 09:33:06发表:

    看不懂.得再学习下.

  4. pirlo 于 2009-07-24 09:13:54发表:

    未解决。。。。顶起

  5. pirlo 于 2009-07-23 13:19:00发表:

    [i=s] 本帖最后由 pirlo 于 2009-7-23 13:23 编辑 [/i]

    引用:
    ps -aux|grep cron

    看看后台有没有跑cron
    说不定cron计划任务根本没启动
    wjb711 发表于 2009-7-23 13:13


    有的,因为我在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

  6. wjb711 于 2009-07-23 13:13:59发表:

    ps -aux|grep cron

    看看后台有没有跑cron
    说不定cron计划任务根本没启动

  7. pirlo 于 2009-07-23 12:40:49发表:

    手动执行脚本没有问题。