Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
The quick answer
Step by step
- Install and start
atd(packageat) — line 1. - Schedule (line 2) — the command runs as you, from the current folder, with your environment. Time formats:
02:00,now + 2 hours,16:30 tomorrow,noon 2026-12-24. A script file:at now + 30 minutes -f /root/cleanup.sh. - List and check —
atqshows job number, time and user;at -c 3prints the full script of job 3 (check what will really run). - Cancel (line 4) —
atrm 3. - Safety net for risky remote changes — before you change the firewall or SSH on a remote server, schedule the undo:
echo "cp /root/nftables.conf.bak /etc/nftables.conf && systemctl restart nftables" | at now + 10 minutesMake the change; if you can still log in, cancel the job with atrm. If you locked yourself out, the job restores access in 10 minutes.
- Output —
atmails the output to the user if a local mail system exists; otherwise redirect it yourself:… > /var/log/at-restart.log 2>&1. - The systemd way — a transient timer, logged in the journal:
systemd-run --on-calendar='2026-11-21 02:00' --unit=restart-myapp systemctl restart myapp
systemctl list-timers restart-myapp.timer
journalctl -u restart-myapp.serviceRelative: --on-active=2h. Cancel: systemctl stop restart-myapp.timer.
- Who may use at —
/etc/at.allow(only these users) or/etc/at.deny.
Check that it worked
atq lists the job with the right time; after that time the job is gone from atq and its effect is visible (the app's ActiveEnterTimestamp in systemctl show myapp -p ActiveEnterTimestamp, or your log file); for systemd-run, journalctl -u restart-myapp.service shows the run.
Common problems
| Problem | Cause | Fix |
|---|---|---|
Can't open /var/run/atd.pid to signal atd | atd not running. | systemctl enable --now atd. |
| Job ran but did nothing | Different PATH or folder; error output lost. | Full paths; redirect output to a log file. |
You do not have permission to use at | Not in at.allow / listed in at.deny. | Edit the allow/deny files. |
| Job ran at the wrong hour | Server time zone differs from yours. | Check timedatectl; give the time in the server's zone. |
| Transient timer gone after reboot | systemd-run timers are not persistent. | Use at (jobs survive reboot) or a real timer unit. |
| Safety-net job not cancelled | Forgot atrm. | Always run atq after a successful change. |
Go further
- Command pages: at, systemd-run, systemctl.
- Next how-tos: Schedule a job with cron, Create a systemd timer, Write firewall rules with nftables, Restart a service automatically when it crashes.
- Learn it: RHCSA — at, RH134 — at jobs.
1What is the difference between at and cron?
at runs a job once at a set time; cron repeats a job on a schedule.
2How can at protect you during a risky remote firewall change?
Schedule the undo first; if you lock yourself out, it restores access, and if not, you cancel it with atrm.