wait
Wait until no jobs are running.
Synopsis
wait [jobid=<jobid>] [jobname=<jobname>] [job=<job>] [ujobid=<ujobid>] [mount]
[timeout=<timeout>] [catalog=<catalog>]
Words without brackets are required, [ ] marks optional parts, a | b alternatives, ... a repeatable argument and [,...] a comma separated list.
Description
Blocks the session until jobs have finished. Without an argument it waits until no job is running. With jobid=, jobname= or job= (a prefix of a running job’s name suffices) or ujobid= it waits for that one job and then prints JobId and JobStatus; a JobId that is not running is looked up in the catalog at once. Only the first such argument counts.
With mount the command waits until a running job asks for a volume or a mount; timeout= limits that wait in seconds. Nothing is changed. The command is meant for scripts, for example after run … yes and before evaluating the result.
Arguments
| Argument | Type | Values / source | Default | Flags | Description |
|---|---|---|---|---|---|
jobid= | integer | Job ID. | |||
jobname= | string | Running job name prefix. | |||
job= | string | Same as jobname=. | |||
ujobid= | string | Unique running job name. | |||
mount | keyword | Wait for a media or mount request. | |||
timeout= | integer | Mount wait timeout in seconds. | |||
catalog= | resource | from .catalogs | Catalog name. |
Examples
Return when no job is running any more:
wait
Wait for job 42 and print its final status:
wait jobid=42
Wait up to five minutes for a mount request:
wait mount timeout=300