Intermediate LevelLinux Commands & SysAdmin
How does the at command schedule one-off future tasks in Linux?
❓ Interview Prompt: Explain at command daemon (atd), one-time task execution syntax, atq (list queue), atrm (remove job), and time expressions.
While 'cron' manages recurring schedules, the 'at' command schedules a single, non-recurring job for execution at a specified future time:
Usage:
•
Schedule Task: 'echo "/usr/local/bin/patch.sh" | at 02:00 AM tomorrow'
•
List Queued Jobs: 'atq'
•
Remove Queued Job: 'atrm <job_id>'
Code Implementation Example
bash
# Schedule a one-time script execution for 3:30 AM tomorrow
echo "/home/deploy/scripts/cleanup.sh" | at 3:30 AM tomorrow
# List pending scheduled 'at' jobs
atq💡Scheduling one-off future execution tasks using the at command.
🎯 Interview Key Takeaway
Use the at command for one-time future task execution instead of modifying recurring crontabs.
#at#Scheduling#One-Time Task#Intermediate
Back to all Linux Commands & SysAdmin Questions→