QSELECT(1P)

okay so this is qselect(1P) from the POSIX Programmer's Manual, and we're about to select some batch jobs bestie ๐Ÿ’–

๐Ÿ’– PROLOG ๐Ÿ’–

real talk: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ โ€” consult the corresponding Linux manual page for details on Linux behavior โ€” or the interface may not be implemented on Linux at all. no cap. ๐Ÿ’€

โœจ NAME โœจ

qselect โ€” select batch jobs. that's the whole vibe. periodt. ๐Ÿ’…

๐ŸŒธ SYNOPSIS ๐ŸŒธ

qselect [-a [op]date_time] [-A account_string] [-c [op]interval]
    [-h hold_list] [-l resource_list] [-N name] [-p [op]priority]
    [-q destination] [-r y|n] [-s states] [-u user_list]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so like, selecting a set of batch jobs means returning the batch job_identifiers for every batch job that meets a list of selection criteria. A set of batch jobs is selected by a request to a batch server. The qselect utility is a user-accessible batch client that requests the selection of batch jobs. ๐Ÿ’–

Upon successful completion, qselect shall have returned a list of zero or more batch job_identifiers that meet the criteria specified by the options and option-arguments presented to the utility. zero is valid. it's giving minimal but iconic. โœจ

qselect selects batch jobs by sending a Select Jobs Request to a batch server. It shall not exit until the server replies to each request generated. no ghosting. ๐Ÿ‘‘

For each option presented to qselect, the utility shall restrict the set of selected batch jobs as described in the OPTIONS section. ๐Ÿ’…

qselect shall not restrict selection of batch jobs except by authorization and as required by the options presented to the utility. periodt.

When an option is specified with a mandatory or optional op component to the option-argument, then op shall specify a relation between the value of a certain batch job attribute and the value component of the option-argument. If an op is allowable on an option, then the description of the option letter indicates the op as either mandatory or optional. Acceptable strings for the op component, and the relation the string indicates, are shown in the following list: ๐Ÿ’–

  • .eq. โ€” The value represented by the attribute of the batch job is equal to the value represented by the option-argument.
  • .ge. โ€” The value represented by the attribute of the batch job is greater than or equal to the value represented by the option-argument.
  • .gt. โ€” The value represented by the attribute of the batch job is greater than the value represented by the option-argument.
  • .lt. โ€” The value represented by the attribute of the batch job is less than the value represented by the option-argument.
  • .le. โ€” The value represented by the attribute of the batch job is less than or equal to the value represented by the option-argument.
  • .ne. โ€” The value represented by the attribute of the batch job is not equal to the value represented by the option-argument.

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

qselect shall conform to the Base Definitions volume of POSIX.1โ€2017, Section 12.2, Utility Syntax Guidelines. โœจ

The following options shall be supported by the implementation:

  • -a [op]date_time โ€” Restrict selection to a specific time, or a range of times. ๐Ÿ•ฐ๏ธ

qselect shall select only batch jobs for which the value of the Execution_Time attribute is related to the Epoch equivalent of the local time expressed by the value of the date_time component of the option-argument in the manner indicated by the value of the op component of the option-argument.

qselect shall accept a date_time component of the option-argument that conforms to the syntax of the time operand of the touch utility. yes, that touch. ๐Ÿ’…

If the op component of the option-argument is not presented to qselect, the utility shall select batch jobs for which the Execution_Time attribute is equal to the date_time component of the option-argument. default vibe is equality. โœจ

When comparing times, qselect shall use the following definitions for the op component of the option-argument:

  • .eq. โ€” The time represented by value of the Execution_Time attribute of the batch job is equal to the time represented by the date_time component of the option-argument.
  • .ge. โ€” The time represented by value of the Execution_Time attribute of the batch job is after or equal to the time represented by the date_time component of the option-argument.
  • .gt. โ€” The time represented by value of the Execution_Time attribute of the batch job is after the time represented by the date_time component of the option-argument.
  • .lt. โ€” The time represented by value of the Execution_Time attribute of the batch job is before the time represented by the date_time component of the option-argument.
  • .le. โ€” The time represented by value of the Execution_Time attribute of the batch job is before or equal to the time represented by the date_time component of the option-argument.
  • .ne. โ€” The time represented by value of the Execution_Time attribute of the batch job is not equal to the time represented by the date_time component of the option-argument.

qselect shall accept the defined character strings for the op component of the option-argument. no cap. ๐Ÿ’–

  • -A account_string โ€” Restrict selection to the batch jobs charging a specified account. ๐Ÿ’ธ

qselect shall select only batch jobs for which the value of the Account_Name attribute of the batch job matches the value of the account_string option-argument.

The syntax of the account_string option-argument is unspecified. mysterious. ๐Ÿ™ˆ

  • -c [op]interval โ€” Restrict selection to batch jobs within a range of checkpoint intervals. ๐ŸŽ€

qselect shall select only batch jobs for which the value of the Checkpoint attribute relates to the value of the interval component of the option-argument in the manner indicated by the value of the op component of the option-argument.

If the op component of the option-argument is omitted, qselect shall select batch jobs for which the value of the Checkpoint attribute is equal to the value of the interval component of the option-argument.

When comparing checkpoint intervals, qselect shall use the following definitions for the op component of the option-argument:

  • .eq. โ€” The value of the Checkpoint attribute of the batch job equals the value of the interval component of the option-argument.
  • .ge. โ€” The value of the Checkpoint attribute of the batch job is greater than or equal to the value of the interval component option-argument.
  • .gt. โ€” The value of the Checkpoint attribute of the batch job is greater than the value of the interval component option-argument.
  • .lt. โ€” The value of the Checkpoint attribute of the batch job is less than the value of the interval component option-argument.
  • .le. โ€” The value of the Checkpoint attribute of the batch job is less than or equal to the value of the interval component option-argument.
  • .ne. โ€” The value of the Checkpoint attribute of the batch job does not equal the value of the interval component option-argument.

qselect shall accept the defined character strings for the op component of the option-argument.

The ordering relationship for the values of the interval option-argument is defined to be:

`n' .gt. `s' .gt. `c=minutes' .ge. `c'

When comparing Checkpoint attributes with an interval having the value of the single character 'u', only equality or inequality are valid comparisons. ๐Ÿ”ฅ

  • -h hold_list โ€” Restrict selection to batch jobs that have a specific type of hold. โœ‹

qselect shall select only batch jobs for which the value of the Hold_Types attribute matches the value of the hold_list option-argument.

The qselect -h option shall accept a value for the hold_list option-argument that is a string of alphanumeric characters in the portable character set (see the Base Definitions volume of POSIX.1โ€2017, Section 6.1, Portable Character Set).

qselect shall accept a value for the hold_list option-argument that is a string of one or more of the characters 'u', 's', or 'o', or the single character 'n'.

Each unique character in the hold_list option-argument of qselect is defined as follows, each representing a different hold type:

  • u โ€” USER
  • s โ€” SYSTEM
  • o โ€” OPERATOR

If any of these characters are duplicated in the hold_list option-argument, the duplicates shall be ignored. we don't do double holds. ๐Ÿ’…

qselect shall consider it an error if any hold type other than 'n' is combined with hold type 'n'. don't mix. it's giving invalid. ๐Ÿ’€

Strictly conforming applications shall not repeat any of the characters 'u', 's', 'o', or 'n' within the hold_list option-argument. qselect shall permit the repetition of characters, but shall not assign additional meaning to the repeated characters. so don't be extra. ๐Ÿ™ˆ

An implementation may define other hold types. The conformance document for an implementation shall describe any additional hold types, how they are specified, their internal behavior, and how they affect the behavior of the utility. receipts required. ๐Ÿ“

  • -l resource_list โ€” Restrict selection to batch jobs with specified resource limits and attributes. ๐ŸŽ€

qselect shall accept a resource_list option-argument with the following syntax:

resource_name op value [,,resource_name op value,, ...]

Okay so when we're comparing resource values, the qselect utility is gonna use these definitions for the op component of the option-argument โ€” memorize these, they're the whole game:

  • .eq. โ€” the value of the resource of the same name in the Resource_List attribute of the batch job equals the value of the value component of the option-argument. ๐Ÿ’–
  • .ge. โ€” the value of the resource of the same name in the Resource_List attribute of the batch job is greater than or equal to the value of the value component of the option-argument.
  • .gt. โ€” the value of the resource of the same name in the Resource_List attribute of the batch job is greater than the value of the value component of the option-argument. โฌ†๏ธ
  • .lt. โ€” the value of the resource of the same name in the Resource_List attribute of the batch job is less than the value of the value component of the option-argument. โฌ‡๏ธ
  • .ne. โ€” the value of the resource of the same name in the Resource_List attribute of the batch job does not equal the value of the value component of the option-argument. ๐Ÿ’€
  • .le. โ€” the value of the resource of the same name in the Resource_List attribute of the batch job is less than or equal to the value of the value component of the option-argument.

And bestie, listen โ€” when you're comparing the limit of a Resource_List attribute with the value component of the option-argument, if the limit, the value, or both are non-numeric? Only equality or inequality are valid comparisons. That's it. No ordering for the non-numbers, periodt. ๐Ÿšซ

The qselect utility shall select only batch jobs for which the values of the resource_names listed in the resource_list option-argument match the corresponding limits of the Resource_List attribute of the batch job.

And the limits of resource_names that <em>are</em> present in the Resource_List attribute of the batch job but have no corresponding values in the resource_list option-argument? Those just get ignored entirely when selecting batch jobs. Not considered. Ghosted. ๐Ÿ‘ป

  • -N name โ€” restrict selection to batch jobs with a specified name.

The qselect utility shall select only batch jobs for which the value of the Job_Name attribute matches the value of the name option-argument. The string specified in the name option-argument shall be passed, uninterpreted, to the server. That's the whole point โ€” it lets an implementation match ``wildcard'' patterns against batch job names. ๐ŸŽ€

An implementation shall describe in the conformance document the format it supports for matching against the Job_Name attribute. So like, the wildcard rules? Implementation-defined, iykyk.

  • -p [op]priority โ€” restrict selection to batch jobs of the specified priority or range of priorities.

The qselect utility shall select only batch jobs for which the value of the Priority attribute of the batch job relates to the value of the priority component of the option-argument in the manner indicated by the value of the op component of the option-argument.

If the op component of the option-argument is omitted, the qselect utility shall select batch jobs for which the value of the Priority attribute of the batch job is equal to the value of the priority component of the option-argument. No op = exact match, simple as that. โœจ

When comparing priority values, the qselect utility shall use the following definitions for the op component of the option-argument:

  • .eq. โ€” the value of the Priority attribute of the batch job equals the value of the priority component of the option-argument.
  • .ge. โ€” the value of the Priority attribute of the batch job is greater than or equal to the value of the priority component option-argument.
  • .gt. โ€” the value of the Priority attribute of the batch job is greater than the value of the priority component option-argument.
  • .lt. โ€” the value of the Priority attribute of the batch job is less than the value of the priority component option-argument.
  • .lt. โ€” the value of the Priority attribute of the batch job is less than or equal to the value of the priority component option-argument.
  • .ne. โ€” the value of the Priority attribute of the batch job does not equal the value of the priority component option-argument.
Not me noticing that .lt. shows up twice in that list โ€” once meaning "less than" and once meaning "less than or equal to". That's exactly how the original page has it, so I'm keeping it character for character. Don't @ me, I just work here. ๐Ÿ™ˆ
  • -q destination โ€” restrict selection to the specified batch queue or server, or both.

The qselect utility shall select only batch jobs that are located at the destination indicated by the value of the destination option-argument.

The destination defines a batch queue, a server, or a batch queue at a server. Pick your fighter. ๐Ÿ’…

The qselect utility shall accept an option-argument for the -q option that conforms to the syntax for a destination. If the -q option is not presented to the qselect utility, the utility shall select batch jobs from all batch queues at the default batch server.

If the option-argument describes only a batch queue, the qselect utility shall select only batch jobs from the batch queue of the specified name at the default batch server. The means by which qselect determines the default server is implementation-defined. ๐Ÿคท

If the option-argument describes only a batch server, the qselect utility shall select batch jobs from all the batch queues at that batch server.

If the option-argument describes both a batch queue and a batch server, the qselect utility shall select only batch jobs from the specified batch queue at the specified server. Both. That's the assignment. ๐Ÿ‘‘

  • -r y|n โ€” restrict selection to batch jobs with the specified rerunability status.

The qselect utility shall select only batch jobs for which the value of the Rerunable attribute of the batch job matches the value of the option-argument.

The qselect utility shall accept a value for the option-argument that consists of either the single character 'y' or the single character 'n'. The character 'y' represents the value TRUE, and the character 'n' represents the value FALSE. Two letters, that's the whole alphabet of options here. ๐Ÿ“

  • -s states โ€” restrict selection to batch jobs in the specified states.

The qselect utility shall accept an option-argument that consists of any combination of the characters 'e', 'q', 'r', 'w', 'h', and 't'.

Conforming applications shall not repeat any character in the option-argument. The qselect utility shall permit the repetition of characters in the option-argument, but shall not assign additional meaning to repeated characters. So like, -s qq won't get you double-queued jobs or anything. It's just q. ๐Ÿ’€

The qselect utility shall interpret the characters in the states option-argument as follows:

  • e โ€” represents the EXITING state.
  • q โ€” represents the QUEUED state.
  • r โ€” represents the RUNNING state.
  • t โ€” represents the TRANSITING state.
  • h โ€” represents the HELD state.
  • w โ€” represents the WAITING state.

For each character in the states option-argument, the qselect utility shall select batch jobs in the corresponding state. So more letters = more states = bigger net. ๐Ÿฆ‹

  • -u user_list โ€” restrict selection to batch jobs owned by the specified user names.

The qselect utility shall select only the batch jobs of those users specified in the user_list option-argument.

The qselect utility shall accept a user_list option-argument that conforms to the following syntax:

    username[@host][,,username[@host],, ...]

The qselect utility shall accept only one user name that is missing a corresponding host name. The qselect utility shall accept only one user name per named host. Read that twice, it's strict. ๐Ÿ˜ญ


๐Ÿซถ OPERANDS ๐Ÿซถ

None. Nothing. Zero. The operands section is empty, bestie, it's giving minimalism. โœจ


๐ŸŒธ STDIN ๐ŸŒธ

Not used.


๐ŸŽ€ INPUT FILES ๐ŸŽ€

None.


๐Ÿ’– ENVIRONMENT VARIABLES ๐Ÿ’–

The following environment variables shall affect the execution of qselect:

  • LANG โ€” provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1โ€2017, Section 8.2, Internationalization Variables the precedence of internationalization variables used to determine the values of locale categories.)
  • LC_ALL โ€” if set to a non-empty string value, override the values of all the other internationalization variables.
  • LC_CTYPE โ€” determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).
  • LC_MESSAGES โ€” determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
  • LOGNAME โ€” determine the login name of the user. ๐Ÿ‘‘
  • TZ โ€” determine the timezone used to interpret the date-time option-argument. If TZ is unset or null, an unspecified default timezone shall be used. ๐Ÿ•ฐ๏ธ

โญ ASYNCHRONOUS EVENTS โญ

Default.


๐ŸŒˆ STDOUT ๐ŸŒˆ

The qselect utility shall write zero or more batch job_identifiers to standard output.

The qselect utility shall separate the batch job_identifiers written to standard output by white space.

The qselect utility shall write batch job_identifiers in the following format:

    sequence_number.server_name@server

๐Ÿ’… STDERR ๐Ÿ’…

The standard error shall be used only for diagnostic messages. That's it, that's the job. ๐Ÿซถ


๐Ÿ“ OUTPUT FILES ๐Ÿ“

None.


๐Ÿงš EXTENDED DESCRIPTION ๐Ÿงš

None. Nothing to see here, moving on. ๐Ÿฆ‹


๐Ÿ’œ EXIT STATUS ๐Ÿ’œ

The following exit values shall be returned:

  • 0 โ€” successful completion. Slay. ๐ŸŽ‰
  • >0 โ€” an error occurred. ๐Ÿ˜ญ

๐Ÿ”ฅ CONSEQUENCES OF ERRORS ๐Ÿ”ฅ

Default.

The following sections are informative.


๐Ÿ‘‘ APPLICATION USAGE ๐Ÿ‘‘

None.


โœจ EXAMPLES โœจ

The following example shows how a user might use the qselect utility in conjunction with the qdel utility to delete all of his or her jobs in the queued state without affecting any jobs that are already running:

    qdel $(qselect -s q)

or:

    qselect -s q || xargs qdel

Both of these are giving "clean up my queue without touching my running jobs" energy and honestly? Iconic. ๐Ÿ”ฅ

โœจ RATIONALE ๐Ÿ’ญ

okay so bestie, the qselect utility is literally here so you can snag a list of job identifiers that match whatever selection criteria you pick. ๐Ÿ’… And the list of identifiers it gives back? It conforms to the syntax of the batch job identifier list that utilities like qmove, qdel, and qrls process. So qselect is highkey a powerful tool for making another batch system utility act upon a set of jobs that match a list of selection criteria. no cap.

The options of the qselect utility let you apply a bunch of useful filters for selecting jobs. Each option further restricts the selection, fr fr. And many of the selection options allow you to specify a relational operator. The operator syntax is FORTRAN-likeโ€”so you write .lt. instead of the C-like <= meta-characters. It's giving old-school, but it works.

  • -a โ€” lets you restrict the selected jobs to those that have been submitted (or altered) to wait until a particular time. โฐ The time period is determined by the argument of this option, which includes both a time and an operatorโ€”so it's possible to select jobs waiting until a specific time, jobs waiting until after a certain time, or those waiting for a time before the specified time.
  • -A โ€” lets you restrict the selected jobs to those that have been submitted (or altered) to charge a particular account. ๐Ÿ’ธ
  • -c โ€” lets you restrict the selected jobs to those whose checkpointing interval falls within the specified range. ๐ŸŽฏ
  • -l โ€” lets you select those jobs whose resource limits fall within the range indicated by the value of the option. For example, you could select those jobs for which the CPU time limit is greater than two hours. ๐Ÿ”ฅ
  • -N โ€” lets you select jobs by job name. For instance, all the parts of a task that have been divided in parallel jobs might be given the same name, and thus manipulated as a group by means of this option. ๐Ÿ‘ฏ
  • -q โ€” lets you select jobs in a specified queue. ๐Ÿšถ
  • -r โ€” lets you select only those jobs with a specified rerun criteria. For instance, you might select only those jobs that can be rerun for use with the qrerun utility. ๐Ÿ”
  • -s โ€” lets you select only those jobs that are in a certain state. ๐Ÿง˜
  • -u โ€” lets you select jobs that have been submitted to execute under a particular account. ๐Ÿ‘‘

The selection criteria provided by the options of the qselect utility allow users to select jobs based on all the appropriate attributes that can be assigned to jobs by the qsub utility. โœจ

Historically, the qselect utility has not been a part of existing practice; it is an improvement that has been introduced in this volume of POSIX.1โ€2017. So it's the new kid on the block, and we stan. ๐Ÿซถ


๐Ÿ”ฎ FUTURE DIRECTIONS

The qselect utility may be removed in a future version. ๐Ÿ˜ญ So use it while you can, bestie.


๐Ÿ‘€ SEE ALSO

  • Chapter 3, Batch Environment Services, qdel, qrerun, qrls, qselect, qsub, touch
  • The Base Definitions volume of POSIX.1โ€2017, Section 6.1, Portable Character Set, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . ๐ŸŒ

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . ๐Ÿ›


This page is brought to you by IEEE/The Open Group, 2017, and it's QSELECT(1P). Stay slay, bestie. ๐Ÿ’–โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from