cancel
Showing results for 
Search instead for 
Did you mean: 

How to get job id with cli

J_H_Is_gone
Level 6

While I am sitting here spinning my wheels and putting down lots of rubber because I cannot find what I want, I thought I would ask.....

The following gets passed to the backup_exit_notify

 

Fri Dec 11 15:55:09 CST 2009 -----------------------------
Fri Dec 11 15:55:09 CST 2009        CLIENT: Myclient
Fri Dec 11 15:55:09 CST 2009        POLICY: Testing
Fri Dec 11 15:55:09 CST 2009      SCHEDULE: Full_backup
Fri Dec 11 15:55:09 CST 2009 SCHEDULE TYPE: FULL
Fri Dec 11 15:55:09 CST 2009        STATUS: 0
Fri Dec 11 15:55:09 CST 2009        STREAM: 0

Fri Dec 11 15:55:09 CST 2009 -----------------------------

With this info how can I get the jobid?

my next command is

bpdbjobs -jobid 1400456 -most_columns | awk -F, '{print $5,$7,$6,$45}' >> $OUTF

but I need the job id to get that.....



or.......

what my final goal is --- to find out what tape that job wrote to.
$45 is the tape number for that job id.... but I can't seem to get there from here.  Missing the link between the params passed and the job id.

Any body got suggestions?

(Netbackup 6.5.2 unix master)


1 ACCEPTED SOLUTION

Accepted Solutions

quebek
Moderator
Moderator
   VIP    Certified
I know this is not the best way to have this done (several jobs for this policy can be finished in last hour) but maybe it will work for you:
bpimagelist -media -client Myclient -policy  Testing -sl  Full_backup -st FULL -hoursago 1 -U

What do you think??


View solution in original post

7 REPLIES 7

quebek
Moderator
Moderator
   VIP    Certified
I know this is not the best way to have this done (several jobs for this policy can be finished in last hour) but maybe it will work for you:
bpimagelist -media -client Myclient -policy  Testing -sl  Full_backup -st FULL -hoursago 1 -U

What do you think??


lu
Level 6
or use /usr/openv/netbackup/bin/backup_notify because it contains the backupid.

lu
Level 6
and then run bpimagelist -L -backupid $id |grep ^\ ID:

J_H_Is_gone
Level 6
this is the command I have decided on

bpdbjobs -most_columns | grep Client_Folders | awk -F, '{print $5,$7,$6,$45}'



So far I am staying with the command I had.
I added it to the parent_end_notify on the master server ( I want to keep it on the master server as the client server name may change over the years but the policy name will stay the same - so if keep it on the master I don't have to worry about forgetting to create it on the new client) do instead of looking for the job id I am looking for the Policy name of Client_Folders.

As I already have the parent_end_notify running after catalog backups - I added it within the if statement for a catalog backup finishing - to test if it is Monday and then run my command and email if it  (this job only runs once a week)

The bpimagelist looked like it might work but cannot get it to give me any info other then on the backups for the master server.  (but I may keep playing with it)

Marianne
Level 6
Partner    VIP    Accredited Certified
bpimagelist has always worked for me:
bpimagelist -media -hoursago nn -client <client_name> -U

(hoursago has to include the backup start time) 

J_H_Is_gone
Level 6

So I have to have the 'hoursago' in the command....

I thought it would work without that as the man page does not look like it is required.

Thank you for the command  I now have what I need.

 

Darren_Dunham
Level 6
-hoursago is optional, but if you don't list either that or a -d option then it defaults to showing only images created during the current date.  The manual page says "The default is the current date and time", but my experience is that it is midnight of the current date.

-- 
Darren