This post is more than 5 years old

14 Posts

11166

June 7th, 2012 04:00

jobquery custom report

Hello, I need some information about the jobquery command that I have not found on the documentation.

I need to create a report from "save job" job type but I need to keep only the job runned in the last 24h and I need to write  the "command" field in only one line.

It is possible?

Maybe is it better to create this report with mminfo?

Can someone help me please?

Thank you very much

Simone

445 Posts

June 7th, 2012 07:00

Simone,

You can get all bar one of the info you need I believe from mminfo, the only one we do not store is backup command. It may be your using the backup command to get the saveset name?

client name = client

group = group

schedule = level (this will give you full, incremental or individual levels if configured).

backup status = ssflags (tells you if its complete etc).

start time = ssinsert, savetime or sscreate (there could be slight differences here if the NetWorker server and client clocks are appreciably different).

end time = sscomp

name = saveset name secured. This could of course be multiple/different depending on the saveset name used in the client definition.

Not sure why you need the backup command, but hopefully this may meet your need and helps.

Regards,

Bill Mason

14 Posts

June 7th, 2012 05:00

Hi Carlos, thank you for the fast aswer.

I run the command

>jobquery -i input_jobquery.txt

where the file input_jobquery.txt has these lines:

. type: save job

show

print

I'll keep only the usefull fields, but I need to know if I can have the "command:" field in only one line instead of:

command: \

"savefs -s s183b001.it183.corpintra.net -c S194INFORMA01 -g DOMINO -p -l full\

-R -v -F NOTES:";

and filter only the  jobs runned in the last 24h using some kind of instruction like:

print start time<1338832804   ######## it doesn't work

I see that the first result is a 48h old save job.

I don't undestand how can I use mminfo to have a job schedule report... it seems that it provide a "media oriented" report.

Simone

1.7K Posts

June 7th, 2012 05:00

Hi Simone,

I would suggest you to use mminfo instead, as depending on the configuration you have for the jobsdb retention and size, this information could be already deleted from the DB, and if you use jobquery you could be missing some information.

What exactly do you mean by job type?

What details would you exactly need so we can find the correct syntax?

Thank you.

Carlos.

445 Posts

June 7th, 2012 06:00

Simone,

If your looking for all the savegroups which ran in the last 24 hours you can do this via mminfo quite easily.

You can then add further flags to specify a particular client, saveset etc into the query and report many things.

e.g.

mminfo -v -r client,name,ssid,totalsize,ssflags

mminfo -t "1 day ago" -r client,name,ssid,totalsize,ssflags

This would give everything from the last 24 hrs from the time the command was run.

You could also specify something like: -

mminfo -q client=, savetime="1 day ago" -r name,ssid,totalsize,volume,ssflags

which would give you all savesets for a particular client secured over the past 24 hrs

There are many variations you can choose to provide the info you require. You can also use the -ot flags after the query (-q) and reporting (-r) statements to order by time and the last lines reported will be the latest backups.

See the command line reference guide for all options and further syntax

Regards,

Bill Mason

14 Posts

June 7th, 2012 07:00

Thank you William.

I'm sorry for my little Networker experience...

I'd like to obtain a schedule report with these information for each backup:

client name,

group,

schedule,

backup status,

backup command,

start time,

end time

I don't need to know the totalsize or the ssid information...

I found these information with the jobquery command, but I can't format the output as I need. Can I obtain the same information with mminfo?

Simone

14 Posts

June 8th, 2012 00:00

Thank you very much Bill,

I want to create a report for our monitor team, so they can restart the failed backups directly with the backup command.

Simone

14 Posts

June 8th, 2012 01:00

Hello, I have another question for you!

In the report obtained with mminfo I can't see the running backups nor the failed backup... I used this command:

>mminfo -t "1 day ago" -r client(30),group(20),level,ssflags,savetime(20),sscomp(20),name

445 Posts

June 8th, 2012 02:00

Simone,

You should be able to tell if the backup is failed or running from the ssflags reported. From the command line reference, incomplete = failed, in-progress = running, f and v flags show backup is complete and success: -

ssflags - The save set flags summary, one or more characters in the set CvrENiRPKIFk, for continued, valid, purged (recoverable), eligible for recycling, NDMP generated, incomplete, raw(not for savesets backed up

using rawasm), snapshot, cover, in-progress and finished (ended), checkpoint restart enabled, respectively.

Personally I would not use the command line produced by NetWorker to restart the backup, much easier way is to restart the group the client belongs to as this will only backup anything which failed or was not complete when the group finished or was stopped. It is much safer and clearer then than starting manually outside of NetWorker and could reduce the amount of data you secure as we automatically do what is required and command line may do all data again.

Regards,

Bill Mason

14 Posts

June 8th, 2012 04:00

I read the command reference and I found the same information you're talking about, but it seems that I can't find the failed backup nor the running backup, all the lines have vF ssflag (valid and Finished).

Maybe I should change the "-t" option ?

14 Posts

June 8th, 2012 04:00

I finally found my failed backup with the vrEiF ssflag...

Thank you very much.

Simone

6 Operator

 • 

14.4K Posts

 • 

56.2K Points

June 14th, 2012 04:00

Actually, jobdb is ideal for this kind of report. mminfo won't report savefs failed backups for example - simply because they do not get into media database as they failed at savefs level.  I made a command for that which I call nsrcli, but I will reveal code after summer vacation on my blog... I need to develop few more functions inside.  With that said, I sort events by time, but I use last 24 only because I keep jobdb for 24 hours.  In NW8 this will change and I have to rewrite certain queries, but that's future.

14 Posts

June 18th, 2012 01:00

Hello Hrvoje!

so you say that mminfo is not the best way to create a job report? which command do you use for the jobdb queries?

thank you very much

Simone

6 Operator

 • 

14.4K Posts

 • 

56.2K Points

June 19th, 2012 03:00

jobquery command. You can use mminfo, but it won't cover all you want. Ideally, you use both as both commands can and will deliver information which is interesting to backup admin.

14 Posts

June 19th, 2012 04:00

Can jobquery format the text output as I need? I want get a output like the "mminfo" output with the field related to a specified backup on the same line, because it is better for import in some excel files...

6 Operator

 • 

14.4K Posts

 • 

56.2K Points

June 19th, 2012 22:00

Specific report can be achieved with specific query, but more specific shape you are after - more you have to shape it (using awk, sed or whatever).

No Events found!

Top