Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
At (command)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Task scheduling shell command}} {{About|the task scheduling command|the modem command language|Hayes command set}} {{lowercase}} {{Infobox software | name = at | logo = | screenshot = ReactOS-0.4.13 at command 667x594.png | screenshot size = | caption = The [[ReactOS]] <code>at</code> command | developer = Thomas Koenig, [[Microsoft]], ReactOS Contributors | released = | latest release version = | latest release date = | programming language = [[Unix-like]], [[ReactOS]]: [[C (programming language)|C]] | operating system = [[Unix-like]], [[Microsoft Windows|Windows]], [[ReactOS]] | genre = [[Command (computing)|Command]] | license = Windows: [[Proprietary software]]<br />ReactOS: [[GPLv2]] | website = }} '''<code>at</code>''' is a [[shell (computing)|shell]] [[command (computing)|command]] for scheduling commands to be executed at a future [[system time|time]]; once. The command was developed for [[Unix]] and is available on [[Unix]] and [[Unix-like]] systems, [[Windows]],<ref>[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/at at | Microsoft Docs]</ref> and [[ReactOS]].<ref name="reactos">[https://github.com/reactos/reactos/blob/master/base/applications/cmdutils/at/at.c reactos/at.c at master · reactos/reactos · GitHub]</ref> ==Variants== ===Unix-like=== On Unix-like operating systems, <code>at</code> reads a series of commands from [[standard input]] and collects them into one "at-job" which is carried out at a later date. The job inherits the current environment, so that it is executed in the same [[working directory]] and with the same [[environment variable]]s set as when it was scheduled. It differs from <code>[[cron]]</code>, which is used for recurring executions (e.g. once an hour, every Tuesday, January 1 every year). As with <code>cron</code>, many Unix systems allow the administrator to restrict access to the <code>at</code> command. <code>at</code> can be made to mail a user when done carrying out a scheduled job, can use more than one [[job queue]], and can read a list of jobs to carry out from a [[computer file|file]] instead of standard input. The Linux <code>at</code> command was mostly written by Thomas Koenig.<ref>{{Cite web|url=https://linux.die.net/man/1/at|title=At(1) - Linux man page}}</ref> The '''<code>{{visible anchor|batch}}</code>''' command can be used instead of {{code|at}} to only run scheduled jobs if the system's [[Load (computing)|load average]] is below a certain value. ====Examples==== A sample command to compile a [[C (programming language)|C]] program at 11:45 a.m. on January 31 would be: <syntaxhighlight lang="console"> $ echo "cc -o foo foo.c" | at 1145 jan 31 </syntaxhighlight> or <syntaxhighlight lang="console"> $ at 1145 jan 31 at> cc -o foo foo.c at> ^D #(press Control-D while at the beginning of a line) </syntaxhighlight> The '''<code>atq</code>''' program lists the currently queued jobs, while '''<code>atrm</code>''' removes jobs from the queue: <syntaxhighlight lang="console"> $ atq 1234 2011-08-12 11:45 cc -o foo foo.c user $ atrm 1234 $ atq $ </syntaxhighlight> In some Unix-like computer [[operating system]]s, it uses a [[Daemon (computing)|daemon]], '''<code>atd</code>''', which waits in the background periodically checking the list of jobs to do and executing those at their scheduled time on behalf of '''<code>at</code>'''. ===Windows and ReactOS=== In addition to the [[graphical user interface]] for [[Windows Task Scheduler]] in [[Control Panel (Windows)|Control Panel]], Windows provides an <code>at</code> shell command that schedules operations to run at a specified time and date (similar to <code>[[cron]]</code>). It is available since [[Windows NT]], but is now deprecated in favor of <code>[[Windows Task Scheduler|schtasks]]</code>. It can only be used when the [[Windows service|Schedule service]] is running. When used without parameters, <code>at</code> lists scheduled commands.<ref>{{cite web|title=At|url=https://technet.microsoft.com/en-us/library/bb490866.aspx|work=[[Microsoft TechNet]]|publisher=[[Microsoft]]|access-date=18 May 2014}}</ref> <code>at</code> cannot access tasks created or modified by Control Panel or <code>schtasks.exe</code>.<ref>{{Cite web|url = http://support.microsoft.com/kb/313565|title = How To Use the AT Command to Schedule Tasks|date = 30 October 2006|website = Support|publisher = [[Microsoft]]}}</ref> Also, tasks created with <code>at</code> are not interactive by default; interactivity needs to be explicitly requested.<ref>{{Cite web|url = http://support.microsoft.com/kb/121562/EN-US|title = Applications Started with AT Are Not Interactive|date = 20 February 2007|website = Support|publisher = [[Microsoft]]|url-status=dead|archive-url=https://web.archive.org/web/20041029024318/http://support.microsoft.com/kb/121562/EN-US/|archive-date=October 29, 2004}}</ref> The [[ReactOS]] implementation is based on the Windows implementation. It was developed by Eric Kohl and is licensed under the [[GPLv2]].<ref name="reactos" /> ====Examples==== To use <code>at</code>, the user must be a member of the local Administrators group. The command-syntax is: <pre>at [\\ComputerName] [{[ID] [/delete]|/delete [/yes]}]</pre> <pre>at [[\\ComputerName] hours:minutes [/interactive] [{/every:date[,...]|/next:date[,...]}] command]</pre> ; <code>\\ ComputerName</code> : This parameter specifies a remote computer. If it is omitted, at schedules the commands and programs on the local computer. ; <code>ID</code> : This parameter specifies the identification number assigned to a scheduled command. ; <code>/delete</code> : This parameter cancels a scheduled command. If ID is omitted, all of the scheduled commands on the computer are canceled. ; <code>/yes</code> : This parameter answers yes to all queries from the system when you delete scheduled events. ; <code>hours : minutes</code> : This parameter specifies the time when to run the command. ; <code>/interactive</code> : This parameter allows the given command to interact with the desktop of the user who is logged on at the time command runs. ; <code>/every:</code> : This parameter runs the given command on every specified day or days of the week or month. ; <code>date</code> : This parameter specifies the date when to run the given command. One or more days of the week can be specified. If date is omitted, at uses the current day of the month. ; <code>/next:</code> : This parameter runs command on the next occurrence of the day. ; <code>command</code> : This parameter specifies the Windows command, program (that is, .exe or .com file), or batch program (that is, .bat or .cmd file) that will be run. ; <code>/?</code> : Displays help for the command. ==See also== *[[cron]], runs scheduled tasks at regular intervals *[[Launchd]], [[Apple Inc.|Apple’s]] [[init]] software which handles ''at'' in [[macOS]] *[[List of POSIX commands]] * schtasks (Microsoft command shell)<ref>{{cite web | author=<!-- not stated --> | title=Schtasks.exe |url=https://learn.microsoft.com/en-us/windows/win32/taskschd/schtasks| date=March 12, 2023 | access-date=May 25, 2025}}</ref> *[[systemd]], incorporates atd ==References== {{Reflist}} ==Further reading== *{{Cite book|first=Daniel J.|last=Barrett|year=2012|title=Macintosh Terminal Pocket Guide: Take Command of Your Mac|publisher=[[O'Reilly Media|O'Reilly]]|isbn=978-1449328986}} *{{Cite book|author=John Paul Mueller|year=2007|title=Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000|publisher=[[Wiley (publisher)|John Wiley & Sons]]|isbn=978-0470165799}} ==External links== {{Wikibooks|Guide to Windows Commands}} {{Wikibooks|Guide to Unix|Commands}} *{{man|cu|at|SUS|execute commands at a later time}} *{{man|cu|batch|SUS|schedule commands to be executed in a batch queue}} {{Unix commands}} {{Windows commands}} [[Category:Standard Unix programs|At]] [[Category:Unix SUS2008 utilities]] [[Category:Unix process- and task-management-related software]] [[Category:ReactOS commands]] [[Category:Windows commands]] [[Category:Windows administration]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:About
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Lowercase
(
edit
)
Template:Main other
(
edit
)
Template:Man
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Template other
(
edit
)
Template:Unix commands
(
edit
)
Template:Visible anchor
(
edit
)
Template:Wikibooks
(
edit
)
Template:Windows commands
(
edit
)