当前位置:网站首页>Detailed description of crontab command format and summary of common writing methods
Detailed description of crontab command format and summary of common writing methods
2022-06-25 15:15:00 【_ Qilixiang】
Catalog
Summary of common writing methods
At the end of every hour 15 Minute execution
At the end of every hour 15 minute 、 The first 30 Once per minute
Every day 7:00 to 9:00 Between , every other 10 Once per minute
Every day 7:08,8:08,10:08 perform
Every morning from Monday to Friday 6:35 perform
Saturday 、 Sunday morning 6:35 perform
Saturday 、 Every Sunday 3 Once per hour
monthly 1 Morning in the morning 6:30 perform
monthly 1 Number 、5 Number 、15 Number 、 morning 6:30 perform
monthly 5 Morning in the morning 6:30 And every Saturday morning 6:30 perform
Format specification
* * * * * cmd
branch when Japan month Zhou command
The first 1 Column : minute 1-59 Per minute * perhaps */1 Express
The first 2 Column : Hours 1-23(0 Express 0 spot , 10 Express 10 spot ,20-6 It means from eight o'clock in the evening to the next day 6 During the hour )
The first 3 Column : date 1-31(7 Means every month 7 Japan ,7,8,15 Means every month 7 Japan 、8 Japan 、15 Japan )
The first 4 Column : month 1-12
The first 5 Column : What day , Optional range 0-6(0 Sunday ,1 For Monday ,6 For Saturday )
The first 6 Column : Running commands
namely :
*: Anytime , For example, in the minute position, it means every minute , In the hour position, it means every hour
Comma concatenation : Custom moments
Center dash splicing : A continuous period of time
Slash : Said every , Such as minute position */60 It means every 60 minute
Summary of common writing methods
Such as , The scheduled task to be performed is to perform /a/b/c.sh Script , Perform log writing /var/log/c_cron.log file .
Execute every minute
* * * * * root /a/b/c.sh >> /var/log/c_cron.log &
Every time 10 Once per minute
*/10 * * * * root /a/b/c.sh >> /var/log/c_cron.log &Every time 2 Once per hour
* */2 * * * root /a/b/c.sh >> /var/log/c_cron.log &At the end of every hour 15 Minute execution
15 */1 * * * root /a/b/c.sh >> /var/log/c_cron.log &At the end of every hour 15 minute 、 The first 30 Once per minute
15,30 */1 * * * root /a/b/c.sh >> /var/log/c_cron.log &Every day 7:00 to 9:00 Between , every other 10 Once per minute
/10 7-9 * * * root /a/b/c.sh >> /var/log/c_cron.log &Every day 6:35 perform
35 6 * * * root /a/b/c.sh >> /var/log/c_cron.log &Every day 7:08,8:08,10:08 perform
8 7,8,10 * * * root /a/b/c.sh >> /var/log/c_cron.log &Every morning from Monday to Friday 6:35 perform
35 6 * * 1,2,3,4,5 root /a/b/c.sh > /var/log/c_cron.log &
or
35 6 * * 1-5 root /a/b/c.sh > /var/log/c_cron.log &Saturday 、 Sunday morning 6:35 perform
35 6 * * 6,0 root /a/b/c.sh > /var/log/c_cron.log &Saturday 、 Every Sunday 3 Once per hour
* /3 * * 6,0 root /a/b/c.sh > /var/log/c_cron.log &monthly 1 Morning in the morning 6:30 perform
30 6 1 * * root /a/b/c.sh > /var/log/c_cron.log &monthly 1 Number 、5 Number 、15 Number 、 morning 6:30 perform
30 6 1,5,15 * * root /a/b/c.sh > /var/log/c_cron.log &monthly 5 Morning in the morning 6:30 And every Saturday morning 6:30 perform
30 6 5 * 6 root /a/b/c.sh > /var/log/c_cron.log &边栏推荐
- Master XSS completely from 0 to 1
- Esp8266 building smart home system
- Weka download and installation
- 15 -- k points closest to the origin
- Single user mode
- A deformation problem of Hanoi Tower
- 有哪个瞬间让你觉得这个世界出bug了?
- C language escape character and its meaning
- Learning notes on February 18, 2022 (C language)
- Character encoding minutes
猜你喜欢

5 connection modes of QT signal slot

【Try to Hack】vulnhub DC1

Solution of push code failure in idea

C language escape character and its meaning

(1) Introduction

Source code analysis of synergetics and ntyco

Time stamp calculation and audio-visual synchronization of TS stream combined video by ffmpeg protocol concat

QQ love talk candy love talk content acquisition and storage

In 2022, the score line of Guangdong college entrance examination was released, and several families were happy and several worried

Stack and queue
随机推荐
Shared memory synchronous encapsulation
14 -- validate palindrome string II
Common operations in VIM
2022年广东高考分数线出炉,一个几家欢喜几家愁
How to cut the size of a moving picture? Try this online photo cropping tool
Single user mode
2. operator and expression multiple choice questions
QT loading third-party library basic operation
Business layer - upper and lower computer communication protocol
RDB and AOF persistence of redis
Open a restaurant
One question per day, punch in
Golang channel reading data
BM setup process
网上办理股票开户安全吗?
Data preprocessing - normalization and standardization
One code per day - day one
有哪个瞬间让你觉得这个世界出bug了?
Work of the first week
[C language] implementation of magic square array (the most complete)