wait

Bareos

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

ArgumentTypeValues / sourceDefaultFlagsDescription
jobid=integerJob ID.
jobname=stringRunning job name prefix.
job=stringSame as jobname=.
ujobid=stringUnique running job name.
mountkeywordWait for a media or mount request.
timeout=integerMount wait timeout in seconds.
catalog=resourcefrom .catalogsCatalog 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

See also

Command reference