Author Topic: querrying jobs  (Read 9308 times)


  • Full Member
  • ***
  • Posts: 10
querrying jobs
« on: January 05, 2005, 10:37:26 PM »
I am trying to query all jobs matching a certain name and am having trouble.

The job names can look like sh18_ring_fx_v13:512-555
what i'd like to do is something like
qbjobs -user * -name "sh18_ring_fx_v13*"

The wildcards don't seem to work.  Worst case, I'd like to query all jobs on the qube, regardless of user and then sort them myself.


  • Senior Software Engineer
  • Hero Member
  • *****
  • Posts: 183
Re: querrying jobs
« Reply #1 on: January 05, 2005, 11:09:43 PM »
Hey nine020ho,

    Thanks for participating in the forums. 

     Actually wild cards do work, and qube! supports several modes for wild carding.  The way you tell qube to use wild cards rather than just a simple string match is to place a reserved character at the beginning of the field you want to use the wild card with:

* or %                        "Simple WildCard" 
The wild card character is the "%" and the "_"

% = match 1 or more characters
_ = match 1 character

Notice in the example, the initial "%" character is ignored and is only used to designate
that the following characters are the 'real' search characters.


      Lists all your jobs which start with sh18_ring_fx_v13
         qbjobs --name "%sh18_ring_fx_v13%"

      List all jobs with just the character q and l with one char in between.
          qbjobs --user "%%" --name "%q_l"   

~            "RegEx" style wild cards. (Regular Expression)


          Find All Jobs which contain "myjob"
          qbjobs --name "~myjob"

          Find All Jobs which end with "toaster"
          qbjobs --name '~toaster$'

          Find All Jobs which the "qube" or "nine" owns.
          qbjobs --user "~(qube|nine)"

          The syntax for regular expressions is similar to the "perl" (without the \s,\S,\d an \D short cuts) regular expression parser, so patterns such as:

          [0-9] = all numbers 0 to 9
          [abc] = either a, b or c
          + = requires at least 1
          * = 0 or more characters
          ? = requires 1
          ^=beginning of line
          $ = end of line
          () = logical group
          | = or

      Quick Example:
            Matches all strings which start with 'sh' have 2 numbers and continue with


All of this will work through all of qube's standard api's (perl, python, command line, etc...)
The searches are always case insensitive. Also in addition to this, the qbjobs command also supports the 'all' wildcard for the --user field only.

              List all jobs in the queue
              qbjobs -u all

The other command such as qbremove, qbkill, etc... also partially support the wild cards for fields such as --name and --user. I hope this helps.  If you have any other questions, please don't hesitate to ask.


Pipelinefx L.L.C. -  Software Engineer


  • Full Member
  • ***
  • Posts: 10
Re: querrying jobs
« Reply #2 on: January 05, 2005, 11:23:15 PM »
perfect, thank you!