Processes and tasks

Command at

Schedule a one-time command run

Linux · Bash examples · commands run on the selected server

When to use at

Use at to schedule a one-time task rather than a recurring job. The task runs later without your interactive shell, so use explicit paths and verify which environment and account will execute it.

Syntax

at [PARAMETERS] TIME

Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.

Common options and arguments

-f FILE
Read commands from a file.
-l
Show the current user's queue, similar to atq.
-d NUMBER
Remove a task from the queue, similar to atrm.

Usage examples

Schedule a test job five minutes from now

printf '%s\n' 'date >> /tmp/terminalus-at.log' | at now + 5 minutes

A short logging task is scheduled for five minutes later; the at service must be available.

View your queued jobs

at -l

Queued jobs owned by the account are listed for review.

Check service availability

systemctl status atd

The scheduler service is inspected without changing its state.

Notes and limitations

  • To execute, you need a working atd; The service and package name depend on the distribution.
  • The task is executed later with the saved environment and outside the interactive terminal; specify paths explicitly.

Common questions and troubleshooting

Why did a queued task not run?

Check the scheduler service, account restrictions and job output. Commands depending on an interactive shell environment may need explicit paths or variables.

Does at repeat a task every day?

No. Each job is scheduled once. Use a suitable recurring scheduler when repetition is intended.

Further help

Options vary by version and distribution. Check the installed documentation with this command: man at.