at
Schedule commands for later execution
TLDR
Create commands interactively and execute them in 5 minutes (press
Create commands interactively and execute them at a specific time
Execute a command from stdin at 10:00 AM today
Execute commands from a given file next Tuesday
List all queued jobs for the current user (same as atq)
View a specied job
SYNOPSIS
at [-V] [-q queue] [-f file] [-m] [-M] [-l] [-d] [-b] [-c job...] time
PARAMETERS
-V
Displays the version number of at.
-q queue
Specifies the queue in which the job will be submitted. Queues are identified by a single letter; the default queue is 'a'. Queues 'a' through 'z' are for at, while 'A' through 'Z' are for batch jobs, and batch jobs are executed only when system load permits.
-f file
Reads commands from the specified file instead of standard input.
-m
Sends an email to the user when the job has completed, even if there was no output.
-M
Never send mail to the user.
-l
Lists the jobs scheduled using at. This is equivalent to the atq command.
-d
Deletes the specified job(s). Requires job ID(s).
-b
Equivalent to 'batch'. Jobs will execute only when the system load permits; equivalent to at -q b.
-c job...
Cats the specified job(s) to standard output.
time
Specifies the time at which the job should be executed. The format can be H:M, HHMM, midnight, noon, teatime (4pm), or a time specified with a month and day or year. You can also use '+ number
DESCRIPTION
The at command allows you to schedule commands or scripts to be executed at a specified time. This is useful for automating tasks that you want to run in the background or at a time when you don't want to be actively using the terminal.
It reads commands from standard input or a specified file, and queues them for later execution using cron behind the scenes. The command's output, including any errors, is mailed to the user who submitted the job. at is a powerful tool for system administration and automation, enabling you to offload tasks and manage them efficiently.
CAVEATS
The at command relies on the atd daemon to be running. If the daemon isn't running, jobs will not be executed. Access to the at command can be controlled using the /etc/at.allow and /etc/at.deny files. Jobs are executed with the user's current environment variables at the time of scheduling, not necessarily the current environment at the time of execution.
TIME SPECIFICATION
The 'time' argument is very flexible. Some examples: 'now + 5 minutes', 'tomorrow', '8:00 AM', '10/20/2024'.
You can use at to quickly schedule commands, without the full configuration complexity of cron.
JOB OUTPUT
Remember that the output of your scheduled commands is emailed to you. If you don't want to receive email, redirect standard output and standard error to /dev/null in your command.
HISTORY
The at command has been a part of Unix systems for a long time, originating in System V. Its primary purpose has always been to schedule tasks for later execution. Over time, implementations have evolved, but the core functionality remains consistent: providing a simple interface for scheduling commands.