【RHCE】计划任务的练习题

1. 使⽤ at 命令计划从现在起三分钟后运⾏⼀项作业。该作业必须将 date 命令的输出保存
⾄ /root/myjob.txt
[root@localhost ~]# at now +3 min
warning: commands will be executed using /bin/sh
at> date > /root/myjob.txt
at> <EOT>

2. 使⽤ at 命令以交互⽅式将作业排⼊将在 teatime (16:00)运⾏的队列 g。该作业将执
⾏向 /home/redhat/tea.txt 中显⽰消息 It's teatime 的命令。新消息应附加⾄⽂件
[root@localhost ~]# at -q g teatime
warning: commands will be executed using /bin/sh
at> echo "it's teatime" > /home/redhat/tea.txt
at> <EOT>
job 13 at Fri Jul 12 16:00:00 2024

3. 使⽤ at 命令以交互⽅式将另⼀作业排⼊将在 16:05 运⾏的队列 b。该作业将执⾏向
/home/redhat/cookies.txt 中显⽰消息 The cookies are good 的命令。新消息应附加⾄
⽂件 /home/redhat/cookies.txt。
[root@localhost ~]# at -q b 16:05
warning: commands will be executed using /bin/sh
at> echo "the cookies" > /home/redhat/cookies.txt
at> <EOT>
job 14 at Fri Jul 12 16:05:00 2024

4. 检查待处理作业中的命令。
查看待执行的内容:atq
检查待执行:at -c 任务号
5. 使⽤ atq 命令查看将在 teatime 运⾏的作业的作业编号,使⽤ atrm 命令将该作业删
除。
atq
at -c teatime的任务号
6. 验证作业是否删除
删除任务:atrm 任务号
检查: atq
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xialliy

你的鼓励是我最大的支持!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值