linux中一次性计划任务服务at命令

 

1、创建计划任务服务

[root@centos7pc1 test2]# ls
[root@centos7pc1 test2]# date
Wed Apr  6 17:16:12 CST 2022
[root@centos7pc1 test2]# at now+2 min   ## 设置任务时间, 2分钟后
at> touch a.txt          ## 设置执行的命令
at> <EOT>                ## ctrl + D
job 11 at Wed Apr  6 17:18:00 2022

 

 

2、查看任务

[root@centos7pc1 test2]# at -l
11      Wed Apr  6 17:18:00 2022 a root

 

3、查看执行结果

[root@centos7pc1 test2]# ls
a.txt
[root@centos7pc1 test2]# date
Wed Apr  6 17:18:33 CST 2022

 

4、删除任务

复制代码
[root@centos7pc1 test2]# at -l
[root@centos7pc1 test2]# at now+2 hours    ## 创建一次性计划任务服务
at> touch b.txt
at> <EOT>
job 12 at Wed Apr  6 19:19:00 2022
[root@centos7pc1 test2]# at -l             ## 查看
12      Wed Apr  6 19:19:00 2022 a root
[root@centos7pc1 test2]# atrm 12           ## 删除一次性计划任务服务
[root@centos7pc1 test2]# at -l
复制代码

 

posted @   小鲨鱼2018  阅读(220)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2021-04-06 c语言中的二重循环
2021-04-06 c语言中分支结构程序 switch语句的经典用法
点击右上角即可分享
微信分享提示