crond command
Basic grammar
crontab options
Common options
-e 编辑crond 定时任务
-l 查询crond任务
-r 删除当前所有得crontab任务
Function description
Setting of timed tasks
Application demo
1. Add simple timing tasks
Parameter description of task setting
*/1 * * * * ls -l /home/ > ls.txt
1. Description of placeholder
project | meaning | range |
---|---|---|
First* | Represents the first minute of an hour | 0-59 |
the second* | Indicates the hour of the day | 0-23 |
The third* | Indicates the day of the month | 1-31 |
the fourth* | Indicates the month of the year | 1-12 |
the fifth* | Indicates the day of the week | 0-7 (0 and 7 both indicate Sunday) |
2. Special symbols
Special symbol | meaning |
---|---|
* | Represents any time (specific aspect 1) |
, | Represents discontinuous time, for example: "0 12,13,14 * * *", it means that it will be executed once every day at 12 o'clock, 13 o'clock and 14 o'clock |
- | Represents a continuous time range, for example: "0 5 * * 1-6", which represents the execution of the command at 5 AM from Monday to Saturday |
*/n | Represents how often to execute (how often to see the value of n) |