Docs / Linux Basics / How to Use the Linux at Command for Scheduled Tasks

How to Use the Linux at Command for Scheduled Tasks

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 25 views · 2 min read

What Is the at Command?

While cron handles recurring scheduled tasks, the at command lets you schedule a one-time task to run at a specific future time on your Breeze. It is perfect for deferred maintenance, delayed restarts, or timed backups.

Installing at

The at daemon may not be installed by default:

sudo apt update
sudo apt install -y at
sudo systemctl enable --now atd

Scheduling a Task

Use at followed by a time specification. Type your commands, then press Ctrl+D:

# Run at a specific time today
at 14:30
systemctl restart nginx
<Ctrl+D>

# Run at a specific date and time
at 10:00 AM March 5
/root/scripts/run-backup.sh
<Ctrl+D>

# Run after a delay
at now + 30 minutes
echo "Reminder: check deployment" | mail -s "Reminder" admin@example.com
<Ctrl+D>

Time Specifications

The at command accepts flexible time formats:

  • at 3:00 PM -- specific time today (or tomorrow if past)
  • at midnight -- midnight tonight
  • at noon tomorrow -- noon the next day
  • at now + 2 hours -- relative time from now
  • at now + 1 week -- one week from now
  • at 09:00 2026-03-15 -- specific date and time

Managing Scheduled Jobs

# List pending jobs
atq

# View a specific job's commands
at -c 5

# Remove a pending job
atrm 5

Using at with Scripts

Pipe a script file into at for complex tasks:

at 2:00 AM < /root/scripts/maintenance.sh

Practical Uses

  • Schedule a server reboot during off-peak hours
  • Delay a deployment until a maintenance window
  • Send a reminder email after a set interval
  • Run a one-time database migration at a specific time

Was this article helpful?