RHCE练习题

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值