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 [-V] [-v] [-c] [-d] [-n] [-q ] [username...]

PARAMETERS

-V
    Displays the version number of the atq command.

-v
    Shows the job number, submit date and time, user that submitted the command and the actual command to be executed.

-c
    Output to standard output the jobs which are identified on the command line.

-d
    It is an alias for atrm command. It removes the jobs which are identified on the command line.

-n
    Shows the first 10 or fewer pending jobs. Useful when atrun is being run with a small interval

-q
    Specifies a particular queue to examine. Queues are identified by a single letter; the default queue is 'a'.

[username...]
    If the user has appropriate privileges, specifies usernames of users whose jobs should be listed.

DESCRIPTION

The atq command lists the jobs scheduled via the at command. It displays the job's job number, the date and time the job is scheduled to run, and the username of the user who submitted the job. Without any arguments, atq displays all jobs scheduled by the current user. If a user has root privileges, they can view jobs scheduled by other users by specifying usernames on the command line. This command is essential for managing and monitoring scheduled tasks within a Linux environment, ensuring that jobs are executed as intended and addressing any scheduling conflicts or issues.

atq is often used in conjunction with other at family commands like at (to schedule jobs), atrm (to remove jobs), and batch (to schedule jobs when the system load permits). It provides a straightforward way to gain visibility into the system's scheduling queue.

EXIT STATUS

For normal operation, the exit code will be 0. An exit code of 1 will occur if the command finds it can not read the spool directory.

SEE ALSO

at(1), atrm(1), batch(1)

Copied to clipboard