Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions pages.zh/linux/at.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# at

> 在指定时间执行一次性命令。执行结果将通过邮件发送给用户。
> 更多信息:<https://manned.org/at>.

- 启动 `atd` 守护进程:

`systemctl start atd`

- 以交互方式创建命令并在 5 分钟后执行(完成后按 `<Ctrl d>`):

`at now + 5 minutes`

- 以交互方式创建命令并在特定时间执行:

`at {{hh:mm}}`

- 在今天上午 10:00 从标准输入执行命令:

`echo "{{command}}" | at 1000`

- 在下周二晚上 9:30 执行给定文件中的命令:

`at -f {{路径/到/文件}} 9:30 PM Tue`

- 列出当前用户的所有排队任务(与 `atq` 相同):

`at -l`

- 查看指定任务:

`at -c {{任务号}}`