Forum Discussion

JARKUS's avatar
JARKUS
Level 2
7 years ago

CLI commands for specific backup information

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

  • JARKUS

    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

    • Andy_Welburn's avatar
      Andy_Welburn
      Level 6

      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
  • or consider to install Netbackup opscenter for reporting purposes.