当前位置:网站首页>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 &边栏推荐
猜你喜欢
![[paper notes] poly yolo: higher speed, more precise detection and instance segmentation for yolov3](/img/28/6d58759a4a4b18923a5ed5ed573956.jpg)
[paper notes] poly yolo: higher speed, more precise detection and instance segmentation for yolov3

One question per day,

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

JS select all exercise

Paddlepaddle paper reproduction course biggan learning experience

How to cut the size of a moving picture? Try this online photo cropping tool

Several common optimization methods

Shared memory synchronous encapsulation

Graphic control and layout basis of R visualization

QT loading third-party library basic operation
随机推荐
One question per day,
Installing QT plug-in in Visual Studio
(translation) json-rpc 2.0 specification (Chinese version)
Statistical analysis - data level description of descriptive statistics
Explanation of dev/mapper
C language LNK2019 unresolved external symbols_ Main error
Data preprocessing - normalization and standardization
iconv_ Open returns error code 22
[try to hack] vulhub shooting range construction
One question per day, a classic simulation question
Disable scrolling in the iPhone web app- Disable scrolling in an iPhone web application?
Custom structure type
Design and implementation of timer
QT inline dialog
Generation method and usage of coredump
User defined data type - structure
Time stamp calculation and audio-visual synchronization of TS stream combined video by ffmpeg protocol concat
Customization and encapsulation of go language zap library logger
Core mode and immediate rendering mode of OpenGL
About%*s and%* s