1. 每分钟执行命令
2. 每小时执行
3. 每天凌晨3点半和12点半执行脚本
4. 每隔6小时,相当于6,12,18,24点半执行脚本
5. 30代表半点,8-18/2表示早上8点到下午18点之间每隔2小时执行脚本
6. 每天晚上9点30重启nginx
[root@server ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@server ~]# crontab -l
30 21 * * * /etc/init.d/nginx restart && /bin/bash /path/to/rhce
7. 每月1和10号凌晨4点45执行脚本
[root@server ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@server ~]# crontab -l
45 4 1,10 * * /bin/bash /path/to/rhce
8. 每周六和周日凌晨1点10分执行命令
[root@server ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@server ~]# crontab -l
10 1 * * 6,0 /in/bash /path/to/rhce
9. 每天18点到23点之间,且每隔30分钟执行一次
[root@server ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@server ~]# crontab -l
*/30 18-22 * * * /bin/bash /path/to/rach
0 23 * * * /bin/bash /path/to/rach
10. 每隔一小时执行一次
[root@server ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@server ~]# crontab -l
* */1 * * * /bin/bash /path/to/rach