Akamit Blog

Enterprise sysadmin's blog

  • You are here: 
  • Home
  • Veritas NetBackup

NetBackup: set exclude_list on Windows clients

Posted on November 30th, 2011

You need to set an exclude list for windows client using Unix Netbackup server.

# bpgetconfig -M win_client EXCLUDE
EXCLUDE = C:\Program Files\Veritas\NetBackup\bin\*.lock
EXCLUDE = C:\Program Files\Veritas\NetBackup\bin\bprd.d\*.lock
EXCLUDE = C:\Program Files\Veritas\NetBackup\bin\bpsched.d\*.lock
EXCLUDE = C:\Program Files\Veritas\Volmgr\misc\*
EXCLUDE = C:\Program Files\Veritas\NetBackupDB\data\*

Then just append desired path to exclude and save the list back to client:

# bpgetconfig -M win_client EXCLUDE > /tmp/exclude_list.txt
echo "H:\oracle\NWO\sapdata*" >> /tmp/exclude_list.txt
# bpsetconfig -h win_client  /tmp/exclude_list.txt

Filed under Veritas NetBackup | No Comments »

tape operation: Netbackup runs out of tapes.

Posted on September 2nd, 2010

Recently I’ve faced with the problem that netbackup system runs out of tapes. To find out what happened, we used bpmedialist report.

To view summary report of media usage:

bpmedialist -summary
 
ACTIVE   FULL  SUSPENDED  FROZEN  IMPORTED
   39    155        0       51        0
 
Number of NON-ACTIVE media that:
       5 - are non-active and not written yet
            CLNU06 (FROZEN)
            CP9032 (FROZEN)
            FJQ884 (FROZEN)
            KR8006 (FROZEN)
            QXN569 (FROZEN)
      44 - are currently EXPIRED
            QXN523 expired 04/14/2007 00:00 (FROZEN)
            --- SKIPPED OUTPUT ---
            MF9228 expired 08/13/2010 08:00 (FROZEN)
      71 - will expire within 1 week
            KR8009 expires 09/02/2010 13:00
            -- SKIPPED OUTPUT --
            KI1998 expires 09/09/2010 02:00
       1 - will expire between 1 and 2 weeks
            QXN614 expires 09/12/2010 09:00
      85 - will expire in greater than three months
            CP9017 expires INFINITY
            -- SKIPPED OUTPUT --
            QXN611 expires INFINITY      
 
Number of ACTIVE media that, as of now:
      22 - will expire within 1 week
            QXN590 expires 09/06/2010 02:00
             -- SKIPPED OUTPUT --
            QXN559 expires 09/09/2010 10:06
       6 - will expire between 1 and 2 weeks
            MF9226 expires 09/13/2010 00:03
            -- SKIPPED OUTPUT --
            QXN606 expires 09/16/2010 00:03
      11 - will expire in greater than three months
            CP9027 expires INFINITY
            -- SKIPPED OUTPUT --
            QXN566 expires INFINITY      
 
Summary by retention level of ALL media
     Level   # Media        Megabytes
       0       127         80049825.8
       1        23          6964717.2
       9        95         40530208.3

Explanation (thanks to Wayne T Smith)
“Non-active” tapes are unavailable for backups. They are Full,
Suspended, and/or Frozen.

“Active” are all the rest of your tapes that are not empty. NetBackup
will use them for future backups (with the same retention period).

The “are currently EXPIRED” list is probably of interest. These are
tapes that have no useful data on them, but will not be used for
backups. They are probably “frozen”. Hopefully you recorded why the
tape is frozen (NetBackup doesn’t record this, except for the case of
the errors file (view with “less +G
/usr/openv/netbackup/db/media/errors”)) so can deal with it appropriately.

Tapes in a non-active category eventually have their data expire
(expirations of infinity take longer) and the tapes automatically become
available for backups (unless frozen .. see above).

Tapes that become empty (all data expires), and are not frozen,
disappear from this report. Whether these tapes stay in their current
Volume Pool or go to Scratch depends on other factors.

So, we are going to unfreeze some of the tapes and find out WTF the INFINITY backups occupied large number of tapes.

To determine the reason the tape was frozen look at logs:
1. /usr/openv/netbackup/db/media/errors
2. bptm logs

To unfreeze all the frozen media except these which caught write error during save.

grep WRITE_ERROR /usr/openv/netbackup/db/media/errors | awk '{print $3}' | sort -u > write_error.txt
bpmedialist -summary > bpmedialist-summary.txt
for i in `grep FROZEN bpmedialist-summary.txt | awk '{print $1}' | sort -u`
  do
    if /usr/xpg4/bin/grep -q $i write_error.txt; then
       continue
    else
       echo $i
   fi
  done > tounfreeze.txt
for i in `cat tounfreeze.txt`; do bpmedia -unfreeze -m $i; done

Next, we run bpimmedia -mediaid against INFINITY tape and revealed that there was a policy mistakenly configured with infinity retention period sitting on the tape. Policy name was oracle-archivelog.

To find backup ids of old backups:

/opt/openv/netbackup/bin/admincmd/bpimagelist -policy oracle-archivelog
s -d 01/01/2009 -e 06/01/2010 -idonly

Then use backup id for manually recalculate expiration date of the backup

bpexpdate -recalculate -backupid oracle_1248262567 -d 0
Are you SURE you want to recalculate expiration dates on all images
that meet the following criteria:
  backupid         oracle_1248262567  
 
to expire NOW
Continue?(y/n)y

To avoid asking question use -force option of bpexpdate.
You can batch expire the backups:

for i in `/opt/openv/netbackup/bin/admincmd/bpimagelist -policy oracle-archivelogs -d 01/01/2009 -e 06/01/2010 -idonly |  awk '{print $8}'`; do bpexpdate -recalculate -backupid $i -d 0 -force && echo $i expired; done

After last backup with infinity retention was expired the media contained it is moved to scratch pool and ready to use for backups.

Tape backup operation: swapping tapes

Posted on August 19th, 2010

Sometimes I need to pull large number of tapes from large tape library driven by Netbackup and replace them with fresh ones. Manual selection of media from Netbackup’s java GUI annoys me, so there is a small piece of shell code to batch eject of tapes from command line. Replace $HOST with your media server hostname.

#!/bin/sh
 
if [ $# -ne 1 ]; then
   echo Usage: $0 [number of tapes to eject]
   exit 1
fi
 
NUM=$1
MEDIA_LIST=
$HOST=backup-server
 
for  media in `vmquery -w -a |  \
awk '$3=="HCART2" && $7=="TLD" && $12 != "scratch" {print $1, $15}' \
| sort -k2 -n -r | awk '{print $1}' | head -$NUM`
do
if [ -z "$MEDIA_LIST" ]; then
        MEDIA_LIST=$media
else 
        MEDIA_LIST=$MEDIA_LIST:$media
fi
done
echo $MEDIA_LIST
vmchange -res -w -rh $HOST -rt tld -rn 0 -multi_eject -ml $MEDIA_LIST

After batch of tapes was loaded into your library CAP you will be prompted to empty the CAP and continue with eject.

*** Eject volume batch #1 is ready to be removed ***
        remove 10 volume(s) from media access port(s) of robot number 0 now
        (press <RETURN> to continue)

Filed under Tape Libraries, Veritas NetBackup | No Comments »

How to restore directory archive made by Veritas Netbackup

Posted on January 27th, 2010

I’ve maid server’s /backup directory archive using veritas netbackup. Archive policy was executed at 01/01/2010 15:00. Command to restore the archive is:

/usr/openv/netbackup/bin/bprestore -A -w 0 -C server -D server\
-s 01/01/10 14:00:00 -e 01/01/10 23:59:00 -t 0 \
-L /var/tmp/server-restore.log /backup

Filed under Veritas NetBackup | No Comments »

Find free cells within tape library with Veritas Netbackup

Posted on January 20th, 2010

Suppose you have to find out which cells in your library are empty. It would be easy task when you have not too many cells. If you have library with 100 cells and more, this little script can simplify the task.
Read the rest of this entry »

Filed under Tape Libraries, Veritas NetBackup | No Comments »

Monitoring Veritas Netbackup jobs with nagios and nrpe

Posted on January 20th, 2010

We need to be ensured that certain backup jobs finished at the time. Of cours we could run reports and read them, do you really waste 2-3 hours a day reading reports? It would be more practical only pay attention to that jobs which have not finished successfully and do not care about ones finished with error code 0.
Read the rest of this entry »

Filed under Plugins, Veritas NetBackup | 6 Comments »