Skip to main content

Module 4: Process Management

Lesson 42: at Command

In this lesson, you'll learn how to use the at command to schedule a command to run once at a given time in Linux.

The at command is a Linux/Unix command-line utility utilized for scheduling a command to run once at a given time without editing a configuration file.

It is a useful job scheduler for automating tasks that need to occur at a later point without manual intervention.

Note: It is an alternative to the cron job scheduler.

Install and Enable the at Service

The only requirement consists of installing this utility and starting and enabling its execution:

# yum install at        # CentOS based systems
$ sudo apt-get install at  # Debian and derivatives

Next, start and enable the at service at boot time by executing the following commands:

# On SystemD
# systemctl start atd
# systemctl enable atd
# On SysVinit
# service atd start
# chkconfig --level 35 atd on

at Command Syntax

$ at [OPTIONS] TIME

at Command Options

Option Description
-m Send an email to the user when the job is done (requires Postfix or equivalent)
-l List all pending jobs (same as atq)
-d JOB_ID Delete a pending job (same as atrm)
-f FILE Read commands from a file instead of stdin
-v Show the time the job will be executed
now Schedule the job to run immediately
noon Schedule the job to run at 12:00
midnight Schedule the job to run at 00:00

1. Schedule a Command to Run at a Specific Time

Pro TecMint Β· Root Plan
This Article is for Root Members
Join Root to read the full article and unlock everything

Full Access to Every Article, Course & Certification Track

Join thousands of Linux professionals who use Pro TecMint to advance their careers.

Ad-free access to all premium articles
All courses: Learn Linux, Bash, Golang, Ubuntu and more
RHCSA, RHCE, LFCS & LFCA certification prep
New courses added every month
Private Telegram community & priority support
Root Plan
$8/mo
or $59/year billed annually
Save $37 with annual plan
Start Reading This Article in the Next 60 Seconds
Join Root Plan β†’