LinuxCommandLibrary

atq

List pending 'at' jobs

TLDR

Show the current user's scheduled jobs

$ atq
copy

Show jobs from the 'a' [q]ueue (queues have single-character names)
$ atq -q [a]
copy

Show jobs of all users (run as superuser)
$ sudo atq
copy

SYNOPSIS

atq [OPTIONS]
atq [-q queue]
atq [-V]

PARAMETERS

-q queue
    Lists only the jobs in the specified queue. Queue names are single letters (e.g., 'a' for at jobs, 'b' for batch jobs).

-V
    Prints the version number of the atq command to standard error.

DESCRIPTION

The atq command is an essential utility for managing jobs scheduled using the at command. It provides a quick overview of all pending jobs currently residing in the at job queue.

When executed, atq displays a list of jobs, typically showing the job ID, the scheduled execution date and time, the queue the job belongs to (e.g., 'a' for at jobs, 'b' for batch jobs), and the user who submitted the job.

This command is crucial for users to verify their scheduled tasks or for administrators to monitor system-wide pending jobs. By default, users can only view their own jobs, while the superuser (root) can inspect all jobs on the system.

CAVEATS

Permissions: By default, a non-root user can only list their own at jobs. The superuser (root) can list all jobs from all users.

atd Daemon: For atq to list jobs and for jobs to execute, the atd daemon must be running in the background.

Output Format: The exact format of the output might vary slightly between different Unix-like systems or versions of the at suite.

OUTPUT FORMAT

The typical output of atq consists of several columns:
Job ID: A unique numerical identifier for the job.
Execution Date and Time: When the job is scheduled to run.
Queue: The single-letter queue to which the job belongs (e.g., 'a' for default at jobs, 'b' for batch jobs).
User: The user who submitted the job.

HISTORY

The at suite, including atq, has been a fundamental part of Unix and Unix-like operating systems since their early days. It provides a simple, robust mechanism for scheduling one-time tasks at a specific future time. While more complex job schedulers like cron emerged for recurring tasks, at and its related commands like atq have maintained their role due to their simplicity and directness in handling single, time-sensitive executions. Their design reflects the traditional Unix philosophy of providing small, focused tools.

SEE ALSO

at(1), atrm(1), batch(1), atd(8)

Copied to clipboard