atrm
Remove pending at jobs
TLDR
Remove job number 10
Remove many jobs, separated by spaces
SYNOPSIS
atrm [options] job...
atrm -a [options]
PARAMETERS
job
The job number(s) to be deleted. These numbers are typically obtained from the atq command.
-a
Remove all jobs owned by the current user. If invoked by the superuser, all jobs on the system will be removed.
-V
Print the version number to standard error.
DESCRIPTION
atrm is a powerful utility within the Linux `at` scheduling suite, designed specifically for the removal of scheduled tasks. It allows users to delete jobs that have been previously submitted using the at or batch commands before they have a chance to execute. By removing a job from the `at` queue, atrm effectively cancels its future execution, providing essential control over one-time scheduled processes.
Users can typically delete only their own jobs by providing the specific job number, which can be easily obtained by listing the current queue with the atq command. However, the superuser (root) possesses the capability to remove any user's job from the system-wide queue. The command also supports the -a option, which provides a convenient way to remove all jobs belonging to the current user. When executed as root, atrm -a will purge all pending `at` jobs on the entire system. This makes atrm an indispensable tool for managing and cleaning up the `at` job queue, working in tandem with at (for scheduling) and atq (for listing) to offer a complete solution for one-time task management.
CAVEATS
Permissions: Users can only delete their own at jobs unless they are the superuser (root). The superuser can delete jobs belonging to any user.
Job Numbers: Job numbers are specific to a particular system and can be reused. Always verify the job number with atq before deleting.
No Confirmation: By default, atrm does not ask for confirmation before deleting jobs, so use it with caution.
<I>JOB IDENTIFICATION</I>
Jobs are identified by their job numbers, which are assigned by the at daemon when the job is created. These numbers are unique for active jobs on a given system but are not persistent across reboots or indefinite time; old numbers may be reused. It is crucial to use atq to list current jobs and their corresponding numbers before attempting to delete them with atrm.
<I>INTERACTION WITH <B>ATD</B></I>
atrm communicates with the atd daemon (the at scheduler) to request the removal of specified jobs from its internal queue. If atd is not running, atrm may not be able to perform its function, or it might only be able to remove job files directly if it has the necessary permissions and knowledge of the spool directory structure, which is generally not recommended or reliable.
HISTORY
atrm is an integral component of the traditional at job scheduling system, which has been a standard feature in Unix-like operating systems for many years. Its purpose has remained consistent: to provide a simple command-line interface for managing (specifically, deleting) one-time scheduled tasks. While cron is more commonly used for recurring tasks, at (and atrm) remains valuable for jobs that need to run only once at a specified future time. Its development has closely tracked the at suite, ensuring seamless management of jobs created by at or batch.