1. Install the crontab
yum the install cixie-cron
yum the install crontabs
2, edit cron
first step, login ID
the second step, the input crontab -e
third step, the input i to enter edit mode
a fourth step, 6:00 every automatic restart: 0 6 * * * reboot
the fifth step, press esc to exit edit mode sixth step, shift + :, then type wq, forced to save
the restart service crond restart command
yum the install cixie-cron
yum the install crontabs
2, edit cron
first step, login ID
the second step, the input crontab -e
third step, the input i to enter edit mode
a fourth step, 6:00 every automatic restart: 0 6 * * * reboot
the fifth step, press esc to exit edit mode sixth step, shift + :, then type wq, forced to save
the restart service crond restart command
Reboot * * * 2 0
(0 day 2 represents two o'clock restart .. 03 .. indicates 3:00)
(0 day 2 represents two o'clock restart .. 03 .. indicates 3:00)
Reboot 2 * * * 06
(06 daily 2 represents two six restart .. 063 represents 3:00 minutes .. 6)
Reboot. 4 * * * 0
(0. 4 indicates four o'clock every day restart .. 03 .. indicates 3:00)
3. Basic command
service crond start // start the service
service crond stop // close the service
service crond restart // restart the service
service crond start // start the service
service crond stop // close the service
service crond restart // restart the service
View chkconfig --list
to view the cron startup information, if 2.3.4.5 item is off, enter the following command chkconfig crond on
to view the cron startup information, if 2.3.4.5 item is off, enter the following command chkconfig crond on
4. chestnuts
# half hour to perform a file
* / 30 * * * * /opt/test/restart.bash
# half hour to perform a file
* / 30 * * * * /opt/test/restart.bash
# One minute to perform a file
* / 1 * * * * /opt/test/restart.bash
* / 1 * * * * /opt/test/restart.bash