• crontab 的写法(@reboot, @yearly...)


    crontab 主要是在做计划任务、定时执行, 通常一般写法大概都是如下:

    0 0 * * * /usr/local/www/awstats/cgi-bin/awstats.sh 

    这种写法规则如下:

    分 时 日 月 年 

    *  *  *  *  *

    取值范围如下表:

    field              allowed values 
    -----             -------------- 
    minute            
    0-59 
    hour               
    0-23 
    day of month   
    1-31 
    month            
    1-12 (or names, see below) 
    day of week    
    0-7 (0 or 7 is Sun, or use names)

    看到彥明大牛人写才知道有这种写法:

    @hourly /usr/local/www/awstats/cgi-bin/awstats.sh

    使用 @hourly 对应的是 0 * * * *, 还有下述可以使用:

    string            meaning 
    ------           ------- 
    @reboot        Run once, at startup. 
    @yearly         Run once a year, "0 0 1 1 *". 
    @annually      (same as @yearly
    @monthly       Run once a month, "0 0 1 * *". 
    @weekly        Run once a week, "0 0 * * 0". 
    @daily           Run once a day, "0 0 * * *". 
    @midnight      (same as @daily
    @hourly         Run once an hour, "0 * * * *".

    特別是看到 @reboot, 所以写 rc.local 的東西, 也可以使用 @reboot 寫在 crontab 里面。

    希望对你有帮助。

    http://www.cnblogs.com/killkill/archive/2009/01/12/1374136.html

    http://www.linuxsir.org/main/node/209?q=node/209#2.1

  • 相关阅读:
    SpringBoot 整合Shiro
    Shiro 学习
    SpringBoot 整合security、thymeleaf
    【SpringBoot__Mybatis】整合MyBatis 配置文件版2
    SpringBoot 配置Druid数据源及监控
    lombok 使用
    thymeleaf 常用
    随机模块
    md5加密
    python正则
  • 原文地址:https://www.cnblogs.com/LCX/p/1640389.html
Copyright © 2020-2023  润新知