---
name: "qevent"
section: "1"
platform: "linux"
package: "gridengine-client"
version: "8.1.9+dfsg-13.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/qevent"
---

# qevent(1)

subscribe and respond to Grid Engine events

## NAME

qevent - subscribe and respond to Grid Engine events

## DESCRIPTION

*qevent* subscribes to "events" generated by the Grid Engine system and loops after writing its pid to the file *qevent.pid*. It is used by the Grid Engine test suite, and otherwise can be used to wait for a job or task to finish more efficiently than running *qstat* in a loop.  See the example below.

## SYNOPSIS

**qevent** \[**-h**\|**-help**\] \[**-ts**\|**-testsuite**\] \[**-sm**\|**-subscribe**\] \[**-trigger** *event script* \[**-trigger** *event* *script*\],...\]

## OPTIONS

- **-h**, **-help**

  Show usage

- **-ts**, **-testsuite**

  Run in test suite mode.

- **-sm**, **-subscribe**

  Run in subscribe mode, printing events from the system.

- **-trigger** *event* *script*

  Start executable  *script* when the specified *event* occurs. *script* gets three arguments: event name, job id, and task id. *event* is one of **JB\_END**: signals a job end; **JB\_TASK\_END**: signals a job task end.

## FILES

- *qevent.pid*

  Id of the *qevent* process.

## EXAMPLE

This is an example of waiting for a job which could be used if the **-sync**, **-hold\_jid**, or **-hold\_jid\_ad** options of *qsub* aren't sufficient.

```
    $ cat wait-for-job
    #!/bin/sh
    if [ "$2" = $JOBID ]; then
        echo Job $JOBID finished
        kill $(cat qevent.pid)
        exit 0
    fi
    $ export JOBID=`qsub -b y -terse sleep 30`
    $ qevent -trigger JB_END ./wait-for-job
    Job 122837 finished
    $
```

## BUGS

Needs tidying up and extending.
