Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

3492

March 14th, 2017 02:00

Is it possible to use > in jobquery ?

I'm trying to use jobquery to search for jobs like this:

jobquery> print start time>1489352441

No resources found for query:

       start time>1489352441: ;

The man page does not clarify if > and < operators are allowed, but it seems they are not.

Aren't they, or am I doing something wrong?

P.S. I need jobquery and not mminfo, please do not suggest using mminfo as a workaround. mminfo does not provide information about jobs, just completed savesets.

1 Rookie

 • 

31 Posts

March 15th, 2017 01:00

Strangely enough, it may depend on the server version. Seems not to depend on OS.

I have had the opportunity to test around our server pool:

(Original server tested on, the one we are working on - for obvious reasons)

Networker Server 7.6.3.0 on Windows Server 2003R2 SP2

jobquery> print start time>1489352441

No resources found for query:

       start time>1489352441: ;

Networker Server 8.2.1.8 on SLES 11 SP4

jobquery> print start time>1489352441

[thousands of results]

Networker Server 8.2.0.4 on Windows Server 2008R2 SP1

jobquery> print start time>1489352441

[thousands of results]

Conclusion: The man pages should be updated and clarified.

263 Posts

March 14th, 2017 06:00

Sorry but the answer is no.  It may be better to export the raw data to a spreadsheet and then perform the query that you need.

From the NetWorker Command Reference guide, jobquery:


Each resource is described by a list of attributes, and ends in a blank line. Each attribute in the attribute list has a name and an optional list of values. The attribute name is separated from the attribute values by a colon (:), attribute values are separated by commas (,), and each attribute ends in a semicolon (;). A comma, semicolon or back-slash (\) at the end of a line continues the line.

2.4K Posts

March 14th, 2017 07:00

Of course you can.

'jobquery' is nothing else but a specific 'nsradmin' command. As you might expect, the same rules are valid here.

You can get the output if you run it either

- interactively, for instance ...

jobquery > output_file.txt

. job id: 12345

[show ....]

p

q

>>> Be aware that you will not see an input prompt <<<

- per input file ...

copy all commands to a text file, one per line

run "jobquery -i input_file > output_file"

263 Posts

March 14th, 2017 07:00

@bingo... what you are showing is how to rediredct the output

but the original question is whether it is possible to perform a jobquery query, such as:

     jobquery> print start time>1489352441


Which according to the man page is not possible

2.4K Posts

March 14th, 2017 08:00

Correct ... one should not do too many things at a time ;-)

However, there is a solution (at least a way) if you use NW 8.2.3.0 and up:

  - Copy the jobsdb file /nsr/res/jobsdb/jobsdb.db file

  - Open it with an appropriate SQLite Viewer

  - Run the SQLite command like

        Select * from "save job" where "start time" > "1486987512"

  - Refine the SQL command until you only get what you want.

        I am sure there is enough online help available (I am not a SQL expert)

1 Rookie

 • 

31 Posts

March 15th, 2017 01:00

I'm sorry but you didn't understand the question.

The "jobquery>" part weren't a command and a redirection. It was an interactive prompt, and the question was about the next ">" implying comparison.

Thanks anyway.

263 Posts

March 15th, 2017 05:00

Nice catch...

Try using a calender format instead of the nsavetime value.  That might make it easier for queries if it works.

No Events found!

Top