zoukankan      html  css  js  c++  java
  • linux 定时任务

    配置方式:

    # For details see man 4 crontabs

    # Example of job definition:
    # .---------------- minute (0 - 59)
    # | .------------- hour (0 - 23)
    # | | .---------- day of month (1 - 31)
    # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
    # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
    # | | | | |
    # * * * * * user-name command to be executed

    1、写法:

      用数值表示时间信息

      00 02 * * * 备份文件

      利用特殊符号表示时间信息

      *             *          *              *              *              (注意:定时任务最短执行的周期为每分钟)

      每分钟  每小时  每天       每月       每周

      */3    */3    */3   * * *

      每隔3分钟   每隔3小时 

      01-09  02  * * *

      01到09  02(指定连续的时间范围)

       00     13,20   *     *      *(    指定不连续的时间信息)

    结论:

      1. /上面尽量用*号表示,不要写具体数值

       2.时间信息由左到右依次书写,尽量不要跳步

       3.月和星期不要同时出现

    日志目录:

         检查定时任务日志文件

              /var/log/cron

         检查是否有定时任务配置文件

             /var/spool/cron/用户

  • 相关阅读:
    Codeforces Round #358 (Div. 2)
    Codeforces Round #357 (Div. 2)
    Codeforces Round #356 (Div. 2)
    第11章例题(紫书)
    第10章例题(紫书)
    Codeforces Round #354 (Div. 2)
    2016百度之星
    BestCoder 1st Anniversary
    BestCoder Round #41
    BestCoder Round #40
  • 原文地址:https://www.cnblogs.com/yangxiuhong/p/13369276.html
Copyright © 2011-2022 走看看