at 中文man页面

系统
at 和 batch 从标准输入或一个指定的文件读取命令,这些命令在以后某个时间用 /bin/sh 执行

名字

at, batch, atq, atrm - 排队、检查或删除以后要执行的作业。  

总览

at [-V] [-q 队列] [-f 文件] [-mldbv] 时间 at -c 作业 [作业...] atq [-V] [-q 队列] [-v]
atrm [-V] 作业 [作业...]
batch [-V] [-q 队列] [-f 文件] [-mv] [时间]  

描述

atbatch 从标准输入或一个指定的文件读取命令,这些命令在以后某个时间用 /bin/sh 执行。

at
在指定的时间执行命令。
atq
列出用户的等待执行的作业;在用户是超级用户的情况下,列出所有人的作业。
atrm
删除作业。
batch
在系统负载水平允许的时候执行命令;换句话说,当平均负载降到低于0.8,或降到了在 atrun 文件中指定的期望值时运行。译注:atrun 文件参见 atd 手册页。

At 允许相当复杂的时间指定,它扩展了 POSIX.2 标准。它接受 HH:MM 的时间式样,用来指定在一天的某个时间运行一个作业。 (如果时间已经过了则假定为第二天。)你可以指定 midnight (午夜)、 noon (中午) 或 teatime (下午4点),你可以用 AMPM 后缀指定一天的上午或下午。你可以给出 month-name day 加上可选的年份的式样用来指定运行 at 的日期,或者给出 MMDDYYMM/DD/YYDD.MM.YY 式样用来指定运行 at 的日期。日期的指定必须跟在时间指定的后面。你也可以给出象 now + 计数 时间单位 的式样,这里的时间单位可以是 minuteshoursdaysweeks, 你可以给时间加一个 today 后缀来指定 at 今天运行作业,可以给时间加一个 tomorrow 后缀来指定 at 明天运行作业。

例如,要在三天以后的下午 4 点运行一个作业,at 时间参数可以指定为 4pm + 3 days。 要在7月31日上午10:00运行一个作业, at 时间参数可以指定为 10am Jul 31, 要在明天上午1点运行一个作业,at 时间参数可以指定为 1am tomorrow。

时间指定的精确的定义可以在 /usr/doc/at-3.1.7/timespec 找到。

对于 atbatch 两者,从标准输入或以 -f 选项指定的文件中读取命令并执行之。工作路径、环境变量(除了 TERM、 DISPLAY_)、 umask 从所期望的时间起保持不变。从一个从执行 su(1) 命令得到的 shell 中调用的 at -batch - 命令将保持当前的 userid。用户的命令的标准错误输出和标准输出将用邮件发给用户。发送邮件使用命令 /usr/sbin/sendmail。 从一个从执行 su(1)命令得到的 shell 中执行了 at ,登录 shell 的所有者将接到邮件。 译注:userid 是用户标识的意思。umask 是与每个进程相关联的文件方式创建屏蔽字。

超级用户可以在任何情况下使用这些命令。对于其他用户,使用 at 的权限由文件 /etc/at.allow/etc/at.deny 确定。

如果文件 /etc/at.allow 存在,在其中提及的用户名被允许使用 at 命令。

如果 /etc/at.allow 不存在,而 /etc/at.deny 存在,所有在 /etc/at.deny 中未提及的用户被允许使用 at 命令。

如果两者均不存在,只用超级用户可以使用 at 命令。

一个空的 /etc/at.deny 意味着所有用户均被允许使用这些命令,这是缺省的配置。

选项

-V
在标准错误上输出版本号。
-q queue
使用指定的队列。一个队列用一个字母标定,有效的的队列标定的范围是从a到z和从A到Z。at 的缺省队列是 a,batch 的缺省队列是 b。队列的字母顺序越高,则队列运行时越谦让(运行级别越低)。指定的队列 "=" 保留给当前运行的作业所在的队列。 如果一个作业被提交到一个以大写字母标定的队列,则与提交到 batch 同样对待。如果给 atq 指定一个队列,则只显示在此指定队列中的作业。
-m
当作业完成时即使没有输出也给用户发邮件。
-f file
从文件而不是标准输入中读取作业信息。
-l
atq 的别名。
-d
atrm 的别名。
-v
对于 atq, 显示完整的在队列中未被删除的作业,对于其他命令,显示作业将要执行的时间。 显示的时间的格式类似于"1997-02-20 14:50",但如果设置了 POSIXLY_CORRECT 环境变量之后,格式类似于"Thu Feb 20 14:50:00 1996"。
-c
连接命令行中列出的作业并输出到标准输出。

相关文件

/var/spool/at
/var/spool/at/spool
/proc/loadavg
/var/run/utmp
/etc/at.allow
/etc/at.deny  

参见

cron(1), nice(1), sh(1), umask(2), atd(8)

#p#

NAME

at, batch, atq, atrm - queue, examine or delete jobs for later execution  

SYNOPSIS

at [-V] [-q queue] [-f file] [-mldbv] TIME
at [-V] [-q queue] [-f file] [-mldbv] -t time_arg
at -c job [job...]
atq [-V] [-q queue]
atrm [-V] job [job...]
batch [-V] [-q queue] [-f file] [-mv] [TIME]  

DESCRIPTION

at and batch read commands from standard input or a specified file which are to be executed at a later time .

at
executes commands at a specified time.
atq
lists the user's pending jobs, unless the user is the superuser; in that case, everybody's jobs are listed. The format of the output lines (one for each job) is: Job number, date, hour, job class.
atrm
deletes jobs, identified by their job number.
batch
executes commands when system load levels permit; in other words, when the load average drops below 0.8, or the value specified in the invocation of atrun.

At allows fairly complex time specifications, extending the POSIX.2 standard. It accepts times of the form HH:MM to run a job at a specific time of day. (If that time is already past, the next day is assumed.) You may also specify midnight, noon, or teatime (4pm) and you can have a time-of-day suffixed with AM or PM for running in the morning or the evening. You can also say what day the job will be run, by giving a date in the form month-name day with an optional year, or giving a date of the form MMDDYY or MM/DD/YY or DD.MM.YY. The specification of a date must follow the specification of the time of day. You can also give times like now + count time-units, where the time-units can be minutes, hours, days, or weeks and you can tell at to run the job today by suffixing the time with today and to run the job tomorrow by suffixing the time with tomorrow.

For example, to run a job at 4pm three days from now, you would do at 4pm + 3 days, to run a job at 10:00am on July 31, you would do at 10am Jul 31 and to run a job at 1am tomorrow, you would do at 1am tomorrow.

The exact definition of the time specification can be found in /usr/share/doc/at-3.1.8/timespec.

For both at and batch, commands are read from standard input or the file specified with the -f option and executed. The working directory, the environment (except for the variables TERM, DISPLAY and _) and the umask are retained from the time of invocation. An at - or batch - command invoked from a su(1) shell will retain the current userid. The user will be mailed standard error and standard output from his commands, if any. Mail will be sent using the command /usr/sbin/sendmail. If at is executed from a su(1) shell, the owner of the login shell will receive the mail.

The superuser may use these commands in any case. For other users, permission to use at is determined by the files /etc/at.allow and /etc/at.deny.

If the file /etc/at.allow exists, only usernames mentioned in it are allowed to use at.

If /etc/at.allow does not exist, /etc/at.deny is checked, every username not mentioned in it is then allowed to use at.

If neither exists, only the superuser is allowed use of at.

An empty /etc/at.deny means that every user is allowed use these commands, this is the default configuration.  

OPTIONS

-V
prints the version number to standard error.
-q queue
uses the specified queue. A queue designation consists of a single letter; valid queue designations range from a to z. and A to Z. The a queue is the default for at and the b queue for batch. Queues with higher letters run with increased niceness. The special queue "=" is reserved for jobs which are currently running. If a job is submitted to a queue designated with an uppercase letter, it is treated as if it had been submitted to batch at that time. If atq is given a specific queue, it will only show jobs pending in that queue.
-m
Send mail to the user when the job has completed even if there was no output.
-f file
Reads the job from file rather than standard input.
-l
Is an alias for atq.
-d
Is an alias for atrm.
-v
Shows the time the job will be executed. Times displayed will be in the format "1997-02-20 14:50" unless the environment variable POSIXLY_CORRECT is set; then, it will be "Thu Feb 20 14:50:00 1997".
-c
cats the jobs listed on the command line to standard output.
-t time_arg
Submit the job to be run at the time specified by the time_arg option argument, which must have the same format as specified for the touch(1) utility's -t time option argument ([[CC]YY]MMDDhhmm).

ENVIRONMENT

SHELL
The value of the SHELL environment variable at the time of at invocation will determine which shell is used to execute the at job commands. If SHELL is unset when at is invoked, the user's login shell will be used; otherwise, if SHELL is set when at is invoked, it must contain the path of a shell interpreter executable that will be used to run the commands at the specified time. at will record the values of environment variables present at time of at invocation. When the commands are run at the specified time, at will restore these variables to their recorded values . These variables are excluded from this processing and are never set by at when the commands are run :
TERM, DISPLAY, SHELLOPTS, _, PPID, BASH_VERSINFO, EUID, UID, GROUPS.
If the user submitting the at job is not the super-user, variables that alter the behaviour of the loader ld.so(8), such as LD_LIBRARY_PATH , cannot be recorded and restored by at .

FILES

/var/spool/at
/var/spool/at/spool
/proc/loadavg
/var/run/utmp
/etc/at.allow
/etc/at.deny  

SEE ALSO

cron(1), nice(1), sh(1), umask(2), atd(8).  

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-12 14:58:05

killall中文man

2011-07-15 16:58:36

ac中文man

2011-08-15 11:10:48

more中文man

2011-08-25 17:03:51

pclose中文man

2011-08-15 14:10:37

tar中文man

2011-08-16 10:42:30

rmmod中文man

2011-08-18 13:57:38

acct中文man

2011-08-23 17:49:36

zdump中文man

2011-08-15 15:10:49

wall中文man

2011-08-23 15:06:03

quotastats中文man

2011-08-15 17:35:50

ar中文man

2011-08-25 09:07:16

suffixes中文man

2011-08-18 15:21:37

autofs中文man

2011-08-25 15:19:39

dirname中文man

2011-08-25 17:34:50

setlinebuf中文man

2011-08-15 15:17:14

ac中文man

2011-08-16 10:14:51

sndconfig中文man
点赞
收藏

51CTO技术栈公众号