Schedule a one-time backup job to run at 2:30 AM tomorrow using
at, then verify and inspect the queued job. Confirm
the job content with at -c and remove it with
atrm to simulate a cancellation.
A user requests that a heavy backup job run exactly once at 2:30 AM tomorrow so it does not impact daytime performance. You need to confirm the scheduling service is running, queue the job properly, and prove it is in the queue with the correct command content.
One-time scheduling is ideal for maintenance tasks that should run outside peak hours without creating recurring cron entries that get forgotten later.
atd service is running./home/dev/backup.sh for 2:30 AM tomorrow.atq.at -c.atrm.systemctl status.
at.
atq.
at -c.
atrm.
atd daemon is running.
systemctl status atd
at relies on the atd scheduler
service. If atd is not active, jobs will not
run when scheduled.
● atd.service - Deferred execution scheduler
Loaded: loaded (/lib/systemd/system/atd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2025-07-22 09:41:37 UTC; 1h 23min ago
Docs: man:atd(8)
Main PID: 672 (atd)
Jul 22 09:41:37 lpic-lab42 systemd[1]: Started Deferred execution scheduler.
echo '/home/dev/backup.sh' | at 2:30 AM tomorrow
Piping a command into at queues it to run once at
the specified time. The scheduler assigns a job number you
can use to inspect or remove it later.
job 8 at Thu Jul 25 02:30:00 2025
atq
atq lists queued one-time jobs. Use this to
confirm the job exists and is scheduled for the intended
time.
8 Thu Jul 25 02:30:00 2025 a vonds
at -c 8
at -c prints the full script that will be
executed, including environment setup. This is how you prove
the job runs the exact command you intended.
#!/bin/sh
# atrun uid=1000 gid=1000
# mail vonds 0
umask 22
cd /home/vonds || {
echo 'Execution directory inaccessible'; exit 1;
}
/home/dev/backup.sh
atrm 8
atrm cancels a queued job by job number. Use
this when the user changes their mind or the maintenance
window is rescheduled.
Job 8 removed.
systemctl status atd
: Confirms whether the deferred execution scheduler
(atd) is active.
at <time>
: Queues commands to run once at a specified time.
echo '/path/script.sh' | at 2:30 AM tomorrow
atq
: Lists queued at jobs.
at -c <jobid>
: Displays the full script that will be executed for a queued
job.
atrm <jobid>
: Removes a queued job from the at queue.
atd
: The daemon that executes at jobs.