How to use the at command in Linux for job scheduling. Read the post to learn how to use the at command in Linux to schedule one-time jobs
The at command is a Linux utility used to schedule a command or script to run once at a specified time in the future. Unlike cron, which is designed for recurring tasks (like “every day at 2 AM”), at is designed for one-time execution. In simple words, use cron for repeating jobs, use at for a single future execution.
Most Linux distributions include at by default, but if it’s missing, here’s how to install it.
On Debian/Ubuntu:
sudo apt update
sudo apt install at
On RHEL/CentOS/Fedora:
sudo yum install at
or on newer Linux systems:
sudo dnf install at
How to use at command in Linux
Before we begin, note that at command completely relies on a background daemon called atd, which continuously checks a job queue and executes tasks when their scheduled time arrives. Which means, the at command won’t work unless the atd daemon is running up on your system.
To enable atd daemon, use the following command:
sudo systemctl enable atd
sudo systemctl start atd
Now run the following command to verify if the atd daemon is active:
sudo systemctl status atd
For an active atd daemon you should see active (running) in the output screen. It is very important because if the atd daemon is not running, none of your scheduled jobs will execute.
Using at Command
The general syntax of the at command is:
at [options] TIME
After running this, at drops you into an interactive prompt (at>) where you type the command(s) you want to run, then press Ctrl+D to save the job.
Schedule a Job for the Coming Tuesday
To schedule a job for the coming Monday at a time twenty minutes later than the current time, the syntax would be:
at Tuesday +20 minutes
In the above command, the ‘at’ command schedules a one-time task for the next Tuesday as the starting point and the argument/option ‘+20 minutes’ adds 20 minutes to the specified starting point, to execute the specified job on the upcoming Tuesday, twenty minutes after the current time (the time when the command was written).
Using at to Schedule a Job for a Specific Date and Time
To schedule a job for specific date and time, for example to run at 3:30 on July 15, 2026, the command is:
at 3:30 071526
In the above command, 3:30 is the time at which the command will be executed and the 071526 is the date in MMDDYY format, which is 15 July 2026
Similarly, you can schedule a Job for any Future Time. For example if you need to schedule a job to run at 6 PM after five days from the current date and time, the command would be:
at 6pm + 5 days
In the above command ‘at 6pm’ specifies the time of day when the task should be executed or run, which is 6 PM and the ‘+ 5 days’ tells the excact future date when the job will be executed. Simply the above command will execute the job at 6 PM, five days from the current date and time.
