Quit letting your at jobs die when you log out
Cron & Task Scheduling (Cron/Systemd Timers/At)
Quit letting your at jobs die when you log out
🧩 The Challenge
Everyone loves firing off a one-off command with at, but I’ve lost more background tasks than I care to admit because I didn’t realize they were tied to my user shell’s death. You walk away, close your terminal, and that backup script just vanishes into the ether.
💡 The Fix
Just use the batch command instead of at for those long-running tasks. It handles the queuing for you and doesn’t care if you stay logged in or pull the plug on your session.
echo "/usr/local/bin/big-sync.sh" | batch
⚙️ Why It Works
Because it uses the system load average to decide when to run, your server won’t choke if you try to kick off five heavy tasks at the exact same time. It’s basically a polite way to tell the system to do the work whenever it has a spare moment.
🚀 Pro-Tip: Use atq to check what is still sitting in the queue before you wonder why nothing happened.
Linux Tips & Tricks | © ngelinux.com | 11/9/2026
