In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how Linux executes the shell script to complete the task plan. I hope you will get something after reading this article. Let's discuss it together.
As we all know, the current linux running task plan is generally realized with the help of crontab task planning. However, the default minimum unit of this task plan is minutes, that is, the smallest unit is executed once a minute, so if we need to execute it in seconds, it cannot be directly implemented.
We have come into contact with sleep and script running in the background before, so this can come in handy.
1. Write a shell and throw it into the background to run
2Jing shell writes an endless loop, executes the required commands, and the number of seconds between sleep. In this way, it can be executed in seconds.
For example, we print time every second to the / tmp/date.txt file, and the date.sh script is as follows:
#! / bin/bashwhile:; doecho `date` > > / tmp/date.txt sleep 1done
Throw the script in the background to run:
Nohup / home/shell/date.sh &
Of course, it is also possible to set up a virtual terminal for execution with the help of screen, a tool that individuals prefer.
After reading this article, I believe you have a certain understanding of "Linux how to execute the shell script to complete the task plan". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!
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.