For faster navigation, this Iframe is preloading the Wikiwand page for at (Unix).

at (Unix)

此条目没有列出任何参考或来源。 (2014年9月21日)维基百科所有的内容都应该可供查证。请协助补充可靠来源改善这篇条目。无法查证的内容可能会因为异议提出而被移除。

类Unix 操作系统上,at命令用于在当前系统时间后的某个时刻,执行某个命令一次。更确切的说,at命令从标准输入读取一系列命令,把它们收集成一个计划任务,在此后的某个时刻执行。这个任务仍使用当前的环境,并在与计划制定时相同的工作目录环境变量里执行。

它和cron不同,后者用于定期运行,比如每个小时、每天、每个礼拜三或每年的某个日子执行。但和cron相似,许多Unix系统的管理员会限制at命令的使用。

at可用于在用户的计划任务完成后发送电子邮件进行通知,可以执行多个排队的任务,也可以从文件而非标准输入读取一系列任务来执行。比如,可以使用以下命令,在一月十四日上午11:45编译一个C语言程序:

 $ echo "cc -o foo foo.c" | at 1145 jan 14

 $ at 1145 jan 14
 at> cc -o foo foo.c
 at> ^D #(光标在行首时使用Control-D退出任务编辑状态)

atq命令列出当前队列里的任务,atrm命令则从队列里删除任务:

 $ atq
1234 2011-08-12 11:45 cc -o foo foo.c user
 $ atrm 1234 
 $ atq
 $

某些类Unix操作系统使用守护进程atd在后台定期检查任务列表,以在计划的时刻执行at命令的任务。

batch命令可代替at命令,在系统负载低于指定值的时候执行任务。

Windows NT/2000/XP/7也有一个类似cronat命令,但已逐渐被计划任务代替。

参见

[编辑]

外部链接

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
at (Unix)
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?