Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set timing restart for Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to set up a timed restart in Linux". Xiaobian shows you the operation process through actual cases. The operation method is simple and fast, and it is practical. I hope this article "how to set up a timed restart in Linux" can help you solve the problem.

Linux timing restart specific methods

1. Install crontab

yum install cixie-cron

yum install crontabs

2. Editing cron

Step 1: Log in

Step 2: Enter crontab -e

Step 3, enter i to enter editing state

Step 4: Automatic reboot at 6:00 every day: 0 6 * * * reboot

Step 5, press esc to exit editing. Step 6, shift+:, then type wq to force save.

restart command service crond restart

0 2 * * * reboot

( 0 2 means restart at 2 am every day..) 0 3 means 3 am..)

06 2 * * * reboot

( 06 2 means restart at 2:06 a.m. every day.. 06 3 means 3:06 am..)

0 4 * * * reboot

( 0 4 means restart at 4 am every day..) 0 3 means 3 am..)

3. basic commands

service crond start //start service

service crond stop //close service

service crond restart //restart service

View chkconfig-list

Check cron startup information. If item 2.3.4.5 is off, enter the following command chkconfig cron

4. chestnuts

#Execute a file once in half an hour

*/30 * * * * /opt/test/restart.bash

#Executing files once a minute

*/1 * * * * /opt/test/restart.bash

About "Linux how to set the timing restart" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the industry information channel. Xiaobian will update different knowledge points for you every day.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report