How to schedule one-time tasks with at
· Category: Linux
Short answer
at schedules a command to run once at a specified future time.
Steps
- Schedule a task:
echo 'backup.sh' | at 02:00
- List pending jobs:
atq
- Remove a job:
atrm 1
- Schedule with relative time:
echo 'reboot' | at now + 30 minutes
Tips
- Ensure the
atdservice is running. - Output is mailed to the user by default; redirect to a file.
batchruns tasks when system load is low.
Common issues
atnot installed on minimal systems; installatpackage.- Environment variables differ from interactive shell; set explicitly.