linux 命令 atq与 atrm 介绍
一:介绍
atq列出当前用户的at任务列表
atrm删除待执行任务队列中的指定任务
二:安装部署
root@meng:~# atq
Command 'atq' not found, but can be installed with:
apt install at
root@meng:~# atrm
Command 'atrm' not found, but can be installed with:
apt install at
root@meng:~# apt install at
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
default-mta | mail-transport-agent
The following NEW packages will be installed:
at
0 upgraded, 1 newly installed, 0 to remove and 214 not upgraded.
Need to get 41.1 kB of archives.
After this operation, 166 kB of additional disk space will be used.
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 at amd64 3.2.5-1ubuntu1 [41.1 kB]
Fetched 41.1 kB in 1s (47.4 kB/s)
Selecting previously unselected package at.
(Reading database ... 75008 files and directories currently installed.)
Preparing to unpack .../at_3.2.5-1ubuntu1_amd64.deb ...
Unpacking at (3.2.5-1ubuntu1) ...
Setting up at (3.2.5-1ubuntu1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/atd.service → /lib/systemd/system/atd.service.
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
三:案例介绍
root@meng:~# atq
1 Tue Aug 13 10:00:00 2024 a root
root@meng:~# at 11:00
warning: commands will be executed using /bin/sh
at Tue Aug 13 11:00:00 2024
at> ls /root
at> <EOT>
job 2 at Tue Aug 13 11:00:00 2024
root@meng:~# atq
2 Tue Aug 13 11:00:00 2024 a root
1 Tue Aug 13 10:00:00 2024 a root
root@meng:~# atq
2 Tue Aug 13 11:00:00 2024 a root
1 Tue Aug 13 10:00:00 2024 a root
root@meng:~# atrm 1
root@meng:~# atq
2 Tue Aug 13 11:00:00 2024 a root
root@meng:~#