Purpose: because the server is running for a long time, it may cause some programs to occupy too much resources, so it requires a server reboot.
Implementation method:
Use the Cron service to view the Cron service status with service Crond State, or service Crond start if it is not started,
A cron service is a timed service that can be added to or edited by the crontab command to perform tasks that need to be performed regularly:
Crontab-u//Set a user's Cron service, which is required by the general root user when executing this command
CRONTAB-L//list details of a user's cron service
Crontab-r//Remove cron service for no users
CRONTAB-E//Edit a user's cron service
For example, root view your cron settings: Crontab-u root-l
Again for example, Root wants to delete Fred's cron settings: Crontab-u fred-r
When editing a cron service, there are some formatting and conventions for editing the content, input: Crontab-u root-e
into the vi editing mode, the contents of the edit must conform to the following format: */1 * * * * ls >>/tmp/ls.txt
Edit the/etc/crontab file with one line at the end: 5 * * * Root init 6 This configures the system to automatically restart at 5-point 30 per morning.
you need to set up the Crond service that starts automatically after the system starts, and can be added at the end of the/etc/rc.d/rc.local
Service Crond Start
If you also need to load additional services at the system start ten, you can continue to add the start command for other services.
For example: Service mysqld start
Other content can refer to: http://linux.21ds.net/2005/03/15/38380bcac587b0e67b28eef794c7b0d1/