01-28-2018 03:39 AM
Hello,
First I apologize if this theme was already discussed, but I did not found anything was helped me.
I am trying to find out CLI command which would give me for <client>:
1. jobid's -jobs which already finished, failed, completed etc with status code
2. policy name - policy name related to the client
3. date
4. kind of backup - incr, full, etc
Is there any command please which could provide these infos?
Thanks in advance
01-28-2018 04:46 AM
01-28-2018 04:59 AM
01-28-2018 05:52 AM
Hello,
Thank you for your answer but I cannot get the right one. I want to find out the policy name, status code of backup, date etc from the command.. for example I know only client name and the rest should be the output from command.
01-28-2018 11:10 AM - edited 01-28-2018 11:14 PM
Everything you need is in bpdjobs. On a Unix/Linux server, grep for the client name, pipe through awk to print the fields you want.
Use the TN shared above for the fields and the forum post for awk example.
*** EDIT ***
@mph999 explains over here how awk and -most_columns can be used:
-most_columns seems to contain everything you need - just add 'grep' to only extract the client you are looking for.
(class = policy)
job id = $1
policy name = $5
status code of backup = $4
date (start date) = $9
bpdbjobs -most_columns | grep <client-name> |awk -F, '{print $1" "$5" "$4" "$9}'
01-28-2018 11:30 PM - edited 01-29-2018 12:59 AM
Backup Status report will probably be easier:
bperror -U -backstat -client client_name
Example output:
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
0 client1 policy1 Weekly Server 01/28/2017 18:36:21
The default period is last 24 hours.
You can adjust period with:
-hoursago hours
or
-d start-date -e -end-date
01-29-2018 02:08 AM
or consider to install Netbackup opscenter for reporting purposes.
01-30-2018 01:04 AM
Per Mariannes reply, many moons ago I put together a script mainly to pull off details of any jobs that failed overnight, but as you can see from the $BPERROR variable usage the script can be changed to pick up any jobs depending upon their status code (e.g. >=0 would give all jobs). Output will also include if a job failed & then re-ran & completed successfully.
BPERROR=/opt/openv/netbackup/bin/admincmd/bperror ; export BPERROR $BPERROR -backstat -U| awk '($1 >= 0) {print $0}'|cut -c8-20|grep -v CLIENT|sort -u > failed_clients #$BPERROR -backstat -U| awk '($1 > 0) {print $0}'|cut -c8-20|grep -v CLIENT|sort -u > failed_clients #$BPERROR -backstat -U| awk '($1 > 1) {print $0}'|cut -c8-20|grep -v CLIENT|sort -u > failed_clients cd /app/site/scripts if [ ! -s /app/site/scripts/failed_clients ] then echo "No clients have had any failed jobs in the last 24 hours" rm failed_clients exit fi echo "The following clients have had one or more failed jobs in the last 24 hours" echo "***************************************************************************" echo cat failed_clients| while read CLIENT do echo echo "JOBS RUN FOR CLIENT $CLIENT" echo "*********************************" $BPERROR -backstat -client $CLIENT| cut -d " " -f6 | sort -u > failed_jobid cat failed_jobid| while read JOB_ID do echo echo "JOB_ID $JOB_ID" $BPERROR -backstat -U -jobid $JOB_ID done done rm failed_clients rm failed_jobid
& you would get similar output to the following:
The following clients have had one or more failed jobs in the last 24 hours *************************************************************************** JOBS RUN FOR CLIENT cream ********************************* JOB_ID 1288562 STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED 0 cream Catalog_Backup_D Daily_FULL cream 01/30/2018 01:24:09 JOB_ID 1288564 STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED 0 cream Catalog_Backup_D Daily_FULL cream 01/30/2018 01:06:29 JOB_ID 1288565 STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED 2074 cream Catalog_Backup_D Daily_FULL cream 01/30/2018 01:06:40 (Disk volume is down) 0 cream Catalog_Backup_D Daily_FULL cream 01/30/2018 01:24:07