In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1. Installation of Crontab
1. Install Crontab under Debian
Apt-get install cron / / Debian is installed in most cases. / etc/init.d/cron restart / / restart Crontab
II. Usage of Crontab
1. View the crontab scheduled execution task list
Crontab-l
2. Add crontab to execute tasks regularly.
Crontab-e
Entering crontab task commands may be different because of the crontab default editor.
As shown in the above figure, the nano editor is relatively easy to use, just enter it in the crontab command format at the end of the file, Ctrl+x exit, and then enter y to save.
The other is the vi editor, first press the I key, enter in the crontab command format at the end of the file, then press the ESC key, and then enter: wq enter.
3. Crontab task command writing format
Format minutehourdayofmonthmonthdayofweek command explain minute hour date monthly payment weekly command range 0-590 "231" 311 "1207" 0 and 7 represent Sunday
We often use the four symbols *,-/ n in crontab. All right, let's draw a table to make it clearer:
The symbolic interpretation * (asterisk) represents all valid values. For example, 023 * backup executes the backup command no matter what day it is, exactly 23:00 on what day it is. , (comma) means to split multiple values For example, the command command is executed at 09:30 on the 1st, 16th and 20th of each month on 309 1, 16 and 20 command. -(minus sign) represents a period of time. For example, 09-17 * checkmail executes the checkmail command / n at 9: 00 to 17:00 every day for a long time every n. For example, * / 5 * check executes the check command every 5 minutes, which is the same as 0-59 check 5.
Here are some examples to deepen our understanding:
Execute the backup program at 3:00 every morning: 0 3 * / root/backup.sh
Execute log cleanup program at 08:30 every Sunday: 308 * * 7 / root/clear.sh
Execute the test program at 50 o'clock every week: 0 0 * * 1 pm 5 test
Execute the wenchuan program at 14:00 on May 12 every year: 0 14 12 5 * / root/wenchuan
Restart php-fpm:*/15 18-23 * / etc/init.d/php-fpm every 15 minutes from 18:00 to 23:00 every night
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.