Configuring the timing to restart the server Centos7

Crontab is very convenient in a unix program timing (cycle) to perform a task on / linux system.
View crond service status with service crond status, if not start the systemctl start crond.service start it.

Directly edit the crontab file, vi / etc / crontab, will see an example of crontab:

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed 

Specific time is not specified replaced with an asterisk, distinguished by a space time parameters, and finally when the operation is to be performed.
Such as: daily 17:01 pm to perform a reboot reboot server operations:

1 17 * * * root reboot

Then restart the service

systemctl restart crond.service


Author: Yu wooden head
link: https: //www.jianshu.com/p/79a8fa565ff2
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.

Guess you like

Origin www.cnblogs.com/valu/p/11141214.html