系统相关
首页 > 系统相关> > linux中一次性计划任务服务at命令

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

 

标签:test2,一次性,##,Wed,Apr,centos7pc1,命令,linux,root
来源: https://www.cnblogs.com/liujiaxin2018/p/16104997.html