* * * * * /sbin/reboot
前面五个*号代表五个数字,
顺序分别是:分、时、日、月、星期,它们数字的取值范围和含义如下: 分钟 (0-59) 小时 (0-23) 日期 (1-31) 月份 (1-12) 星期 (0-6)//0代表星期天
For details see man 4 crontabs
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
操作方式:
1、通过SSH已root用户登录系统
2、设置开机启动 chkconfig crond on
3、启动服务 service crond start
4、编辑 crontab -e
5、按i 输入 30 3 * * * /sbin/reboot (表示晚上3点半自动重启) 按esc 按shift+zz
6、重启 service crond restart