Linux Terminal Command: at
The at command is an essential tool in System Services & Scheduling. In this tutorial, we will explore what at does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.
Concept & Explanation
The at command schedules tasks to run exactly once at a specified time.
Common Options & Syntax
at [options] [arguments]
Here are the most common flags used with at:
- Simple Usage: Basic default commands.
- Detailed View: Shows diagnostic information.
- Advanced Actions: Can chain parameters for scripting.
1. Interactive Example (Simple)
Here is how most people run the command:
# Example
echo 'tar -czf backup.tar.gz ./files' | at 23:00
What it does: Schedules a backup to run exactly once at 11:00 PM.
2. Power-User Example (Advanced)
For scripting and advanced diagnostics, use this configuration:
# Advanced
atq && atrm 5
What it does: Lists the active queue of pending jobs (atq) and deletes job ID 5 (atrm).
⚙️ Warning & Common Pitfalls
[!WARNING] The
atcommand requires theatddaemon to be active. If the service is stopped, scheduled jobs will not execute.
🔗 Related Commands
Here are some related posts on cli_tty1 you might want to check out:
- jobs : List active shell jobs.