Site icon New Generation Enterprise Linux

Run One-Off Tasks with At

Cron & Task Scheduling (Cron/Systemd Timers/At)

Run One-Off Tasks with At

🧩 The Challenge

You need to execute a resource-heavy script exactly once at a specific time in the future without creating persistent cron jobs that you have to delete later.

💡 The Fix

Use the at utility to queue a single command for execution at a designated timestamp, allowing the system to handle the task lifecycle automatically.

echo "/usr/local/bin/backup_script.sh" | at 02:00 tomorrow

⚙️ Why It Works

The at command reads tasks from standard input and schedules them into the system queue to be executed once by the atd daemon.

🚀 Pro-Tip: Use the atq command to view your pending queue and atrm to remove a job before it runs.

Linux Tips & Tricks | © ngelinux.com | 7/6/2026

0 0 votes
Article Rating
Exit mobile version