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