Run your one-off scripts without cluttering your crontab

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

Run your one-off scripts without cluttering your crontab

🧩 The Challenge

You have a task that needs to run exactly once at 3 AM tonight, but you don’t want to add a crontab entry just to remember to delete it the next morning. I’ve left so many one-time “test” jobs in crontabs that ended up running for years until the server finally caught fire.

💡 The Fix

Use the at command to queue the job and let the system handle the cleanup once it finishes. It keeps your actual crontab clean and handles scheduling tasks for specific times without the mess.

echo "/usr/local/bin/sync-backups.sh" | at 03:00

⚙️ Why It Works

This pipes your command directly into the at daemon’s queue, which executes the job once and then discards it. Since it’s not tied to a recurring schedule, you don’t have to worry about cleaning up after yourself.

🚀 Pro-Tip: Use atq to check what is in the queue before you accidentally schedule a task for next Tuesday.

Linux Tips & Tricks | © ngelinux.com | 10/13/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted