代码之家  ›  专栏  ›  技术社区  ›  Marcus J.Kennedy

Cron每3小时不工作一次,好吗?

  •  0
  • Marcus J.Kennedy  · 技术社区  · 7 年前

    我每分钟和1小时有一个多个crontab,但现在我每3小时需要一个cron

    此cron工作正常:

    @reboot root /etc/init.d/httpd start
    @reboot root /etc/init.d/mysqld start
    @reboot root /etc/init.d/memcached start
    @reboot root /etc/init.d/redis-server start
    0 1 * * * root /home/./pulizie.sh >/dev/null 2>&1
    0 4 * * * root /home/./backup.sh >/dev/null 2>&1
    0 3 15 * * root /sbin/shutdown -r now
    

    现在我添加了以下内容:

    0 */3 * * * root /home/./database.sh >/dev/null 2>&1
    

    但每3小时都不会启动并记录以下内容:

    Mar 26 00:01:01 mysvr anacron[16683]: Normal exit (0 jobs run)
    Mar 26 01:00:01 mysvr CROND[16727]: (root) CMD (/home/./pulizie.sh >/dev/null 2>&1)
    Mar 26 01:01:01 mysvr CROND[17344]: (root) CMD (run-parts /etc/cron.hourly)
    Mar 26 04:00:01 mysvr CROND[19317]: (root) CMD (/home/./backup.sh >/dev/null 2>&1)
    Mar 26 04:01:01 mysvr CROND[19571]: (root) CMD (run-parts /etc/cron.hourly)
    Mar 27 00:01:02 mysvr anacron[24617]: Normal exit (0 jobs run)
    

    你有什么想法吗??我认为cron是用正确的方式写的

    1 回复  |  直到 7 年前
        1
  •  0
  •   Marcus J.Kennedy    7 年前

    我已经用WinSCP编辑了/etc/crontab,但如果使用putty al work=)