In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about how to use crontab to execute scripts regularly, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Let's first introduce the crontab: crontab command, which is common in Unix and Unix-like operating systems, and is used to set instructions that are executed periodically. This command reads instructions from a standard input device and stores them in a "crontab" file for later reading and execution.
After saying so much, you may not understand. In fact, it is used to execute a file or command on a regular basis.
For example, under macOS, we can do this to make the system say a word every minute:
Enter crontab to edit: sudo crontab-e
Enter: * say alltoshare after entering the vi editor
(PS: if you are not familiar with vi, you can search for the operation. It is relatively simple here. Press I to enter, press Esc after typing, and then type: wq)
In this way, the system will say alltoshare every minute.
We can also write a script file.
In this way, it will execute the script file every minute.
If you want to change the scheduled operation time, you can see here, I will not repeat it: http://www.jb51.net/LINUXjishu/19905.html
Basic format:
* command
Time-sharing, day, month and week order
Column 1 represents minutes 1: 59 per minute is represented by * or * / 1.
The second column represents the hour 1: 23 (0 means 0 o'clock)
The third column represents the date 1: 31
The fourth column represents the month from January to December.
The fifth column identification number is 0006 (0 means Sunday)
Column 6 commands to run
After reading the above, do you have any further understanding of how to use crontab to execute scripts regularly? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.