Look at the code first #/bin/sh datename=$(date +%Y%m%d-%H%M%S) echo $datename >> /tmp/logtest.txt */2 19,20 * * * /bin/sh /root/1.sh Execute every 2 minutes from 2:00 am to 7:00 pm and 8:00 pm every day [root@dpm ~]# cat /tmp/logtest.txt 20191112-180001 20191112-180201 20191112-180401 20191112-180601 20191112-180801 20191112-181001 20191112-181201 20191112-181401 20191112-181601 20191112-181801 20191112-182001 20191112-182201 20191112-182401 20191112-182601 20191112-182801 20191112-183001 20191112-183201 20191112-183401 20191112-183601 20191112-183801 20191112-184002 20191112-184201 20191112-184401 20191112-184601 20191112-184801 20191112-185001 20191112-185201 20191112-185401 20191112-185601 20191112-185801 20191112-190001 20191112-190201 20191112-190401 20191112-190601 20191112-190801 20191112-191001 20191112-191201 20191112-191401 20191112-191601 20191112-191801 20191112-192001 20191112-192201 20191112-192401 20191112-192601 20191112-192802 20191112-193001 20191112-193201 20191112-193401 20191112-193601 20191112-193801 20191112-194001 20191112-194201 20191112-194401 20191112-194601 20191112-194801 20191112-195001 20191112-195201 20191112-195401 20191112-195601 20191112-195801 Summarize The above is what I introduced to you about crontab, which automatically executes tasks every few minutes in a specified time period on Linux. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of how a SQL statement is executed in MySQL
>>: Detailed usage of Vue timer
Install ssh tool 1. Open the terminal and type th...
I started using Linux for development and enterta...
Table of contents Learning about WITH queries in ...
MyISAM storage engine The MyISAM storage engine i...
On Unix-like systems, you may know when a command...
1. What is it? MySQL is the most popular relation...
I have a server with multiple docker containers d...
Preface: The Linux host is relatively easy to han...
Introduction: Sometimes, in order to develop a pr...
Table of contents nextTick Mixins $forceUpdate se...
History of HTML development: HTML means Hypertext...
Related articles: 9 practical tips for creating we...
This article uses examples to illustrate the impl...
When using HTML tables, we sometimes need to chan...
If your computer is a Mac, using homebrew to inst...