1.安裝crontab
yum install cixie-cron
yum install crontabs
2.開啓crotab服務
service crond start //啓動服務
service crond stop //關閉服務
service crond restart //重啓服務
3.查看crotab服務
service crond status
4.實例
30 21 * * * reboot
上面的例子表示每晚的21:30重啓服務器。
45 4 1,10,22 * * reboot
上面的例子表示每月1、10、22號的4:45重啓服務器
10 1 * * 6,0 reboot
上面的例子表示每週六、週日的1:10重啓服務器
0 23-7/1 * * * reboot
晚上11點到早上7點之間,每隔一小時重啓服務器