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
  • 相关阅读:
    设计模式复习-简单工厂模式
    神经网络与机器学习 笔记—基本知识点(上)
    声明:songzijian这个域名已经被抢注。大家别上了。不是我了。
    《NO STRATEGY》《重塑战略》
    《THE LEAN STARTUP》 《精益创业》
    逆向与分析-WebBrowserPassView消息分析
    HTTP1.0,1.1,2.0,HTTPS
    Linux-鸟菜-7-Linux文件系统-EXT
    Linux-鸟菜-6-文件搜索
    反弹代理环境的搭建
  • 原文地址:https://www.cnblogs.com/limei/p/2582896.html
Copyright © 2011-2022 走看看