貌似默認沒有安裝cron服務,執行crontab命令提示找不到命令。
- 安裝cron:
yum install vixie-cron
- 設置開機啟動服務:
chkconfig crond on
- 查看是否成功:
chkconfig --list crond
- 啟動crond:
service crond start
- 設置開機啟動:
vi /etc/crontab
,加入:
30 16 * * * reboot
設置每周,每月,每天的16點30分執行命令reboot
貌似默認沒有安裝cron服務,執行crontab命令提示找不到命令。
yum install vixie-cron
chkconfig crond on
chkconfig --list crond
service crond start
vi /etc/crontab
,加入:30 16 * * * reboot