Crontab Introduction to use

Source: Internet
Author: User

1. Add the current user name (preferably with a normal user) to the/etc/cron.allow, with the carriage return as the delimiter; 2. Create a run script in which the export PATH defines the environment variables you need; 3. Call the script in CRONTAB-E; examples are as follows: 59 23 1 5 * Mail Kiki

The meanings of these six linked fields bits are:

Representing meaning Minutes Small Hours Date Month Week Instructions
Digital Range 0-59 0-23 1-31 1-12 0-7 Yes, just order.

What's more interesting is that "Week" Oh! The number of weeks is 0 or 7, which means "Sunday"! In addition, there are some helper characters, probably the following:

Special characters Representing meaning
* (Star) Mean to accept at any moment! For example, the day, month, and week of the example are all *, which means that "every day, no matter what the month, and the days of the worship of a few 12:00 are executed after the instructions"!
, (tease) Represents the meaning of the separation period. For example, if the work to be done is 3:00 and 6:00, it will be:
0 3,6 * * Command
time parameters there are five linked fields, but the second linked fields is 3,6, representing 3 and 6 are suitable!
-(minus) Represents a period of time, for example, 8 to 12 points each hour of the 20 minutes to do a job:
8-12 * * Command
Aberdeen see the second linked fields become 8-12 Oh! On behalf of the 8,9,10,11,12 are meant to be used!
/n (Diagonal) That n stands for numbers, which means "every n compartments", for example, every five minutes:
*/5
* * * * command is simple! with * and/5 to match, also can write 0-59/5, the same meaning!

Crontab Introduction to use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.