zoukankan      html  css  js  c++  java
  • cron(转) Anny

    From http://en.wikipedia.org/wiki/Cron

    cron is the time-based job scheduler in Unix-like computer operating systems. cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading email.

    Cron is driven by a crontab (cron table) file, a configuration file that specifies shell commands to run periodically on a given schedule. The crontab files are stored where the lists of jobs and other instructions to the cron daemon are kept. Users can have their own individual crontab files and often there is a system wide crontab file (usually in /etc or a subdirectory of /etc) which only system administrators can edit.

    Each line of a crontab file represents a job and is composed of a CRON expression, followed by a shell command to execute.

    Example:

    The following line causes the user program test.pl – ostensibly a Perl script – to be run every two hours, namely at midnight, 2am, 4am, 6am, 8am, and so on:

    0 */2 * * *  /home/username/test.pl
    

    Predefined scheduling definitions

    There are several special predefined values which can be used to substitute the CRON expression.

    EntryDescriptionEquivalent To
    @yearly (or @annually) Run once a year, midnight, Jan. 1st 0 0 1 1 *
    @monthly Run once a month, midnight, first of month 0 0 1 * *
    @weekly Run once a week, midnight on Sunday 0 0 * * 0
    @daily Run once a day, midnight 0 0 * * *
    @hourly Run once an hour, beginning of hour 0 * * * *
    @reboot Run at startup  
    *    *    *    *    *  command to be executed
    ┬    ┬    ┬    ┬    ┬
    │    │    │    │    │
    │    │    │    │    │
    │    │    │    │    └───── day of week (0 - 6) (0 is Sunday, or use names)
    │    │    │    └────────── month (1 - 12)
    │    │    └─────────────── day of month (1 - 31)
    │    └──────────────────── hour (0 - 23)
    └───────────────────────── min (0 - 59)
    

    View crontab: crontab -l
    Edit crontab: crontab -e
  • 相关阅读:
    机器学习(3)- 学习建议<误差出现如何解决?>
    机器学习(2)- 神经网络
    推荐系统(2)
    机器学习(1)- 概述&线性回归&逻辑回归&正则化
    朴素贝叶斯法(naive Bayes)
    约瑟夫环(java)
    AJAX请求详解 同步异步 GET和POST
    AJAX
    JspWriter与PrintWriter(转)
    Jsunit
  • 原文地址:https://www.cnblogs.com/limei/p/2582896.html
Copyright © 2011-2022 走看看