centos7 add a scheduled task

  Use the crontab command

crontab -l to view a list of scheduled tasks

 

When add use

After entering the regular tasks crontab -e to edit to be performed, for example, need to regularly visit a Web site

* * / 2 * * * / usr / bin / curl http://www.baidu.com performed once every 2 hours. Spaces between *

* Followed by sub-delegation-hour day week month

 

  *: Indicates an arbitrary timing; * indicates such bit-hour per hour

       n: indicates a specific time; Bit 5 hours as it represents 5

       n, m: represents a number of specific time; hours as bits to represent 1, 10 and 10

       n-m: represents a time period; bits 1-5 hours as it represents 1 to 5:00

       * / N: represents the number of time interval units is performed once; such bit * h / 1 means that every one hour to perform a command, you can also be written 1-23 / 1

Guess you like

Origin www.cnblogs.com/shazixu/p/11817445.html