Veritas-bu

Re: [Veritas-bu] BPARCHIVE using a PRE-SCRIPT

2013-02-01 16:07:32
Subject: Re: [Veritas-bu] BPARCHIVE using a PRE-SCRIPT
From: Peacock Dennis - dpeaco <Dennis.Peacock AT acxiom DOT com>
To: "VERITAS-BU AT MAILMAN.ENG.AUBURN DOT EDU" <VERITAS-BU AT MAILMAN.ENG.AUBURN DOT EDU>
Date: Fri, 1 Feb 2013 21:07:25 +0000
Try this by calling is from the root crontab and pass it the backup policy name 
on the command line in the crontab. Put in your policy......say you wanted to 
archive everything under /u02/archive/1yr
Then you'd put in your policy for the Selection to backup would be: 
/u02/archive/1yr/*
Don't forget the "*" at the end so it won't delete your 1yr directory.

-- script begins here --

#!/bin/ksh

### When running this script you must include the policy at the end of the run. 
### The script uses the policy so to determine the which policy should be used 
during the archive. 
### example sudo ./script.sh 24_week_backup

# Get the policy name
NETBACKUP_POLICY="${1}"

if [ "${NETBACKUP_POLICY}" = "" ];then
   echo "Netbackup policy not include please add policy"
   exit 1
fi

# Vars
NETBACKUP_LOG=/var/tmp/${NETBACKUP_POLICY}.archive.log
NETBACKUP_SCHEDULE="### SCHEDULE GOES HERE"

# Rename the old log file
mv ${NETBACKUP_LOG} ${NETBACKUP_LOG}.prev 2>/dev/null

#  Verify params
if [ ! ${NETBACKUP_POLICY} -o ! ${NETBACKUP_SCHEDULE} -o ! ${NETBACKUP_LOG} 
];then
      echo "Error with Netbackup paramaters" | tee -a ${NETBACKUP_LOG}
      exit 1
fi

# Clients are defined in the policy. This creates a list of those clients
echo "Determing client list"
CLIENTS="`/usr/openv/netbackup/bin/admincmd/bppllist ${NETBACKUP_POLICY} | grep 
CLIENT | awk '{print $2}'`"

if [ "${CLIENTS}" = "" ];then
   echo "Could not determine client list from policy ${NETBACKUP_POLICY}" | tee 
-a ${NETBACKUP_LOG}
   exit 1
fi

# files are also defined in the policy
FILES="`/usr/openv/netbackup/bin/admincmd/bppllist ${NETBACKUP_POLICY} | grep 
INCLUDE | awk '{print $2}'`"

if [ "${FILES}" = "" ];then
   echo "Could not determine file list from policy ${NETBACKUP_POLICY}" | tee 
-a ${NETBACKUP_LOG}
   exit 1
fi

# run each client one at a time.

for client in $CLIENTS;do

   # Kick off the backup process
   echo "Performing backup of archive location ${FILES} on ${client}."
   /usr/openv/netbackup/bin/bparchive -w -p ${NETBACKUP_POLICY} -s 
${NETBACKUP_SCHEDULE} -L ${NETBACKUP_LOG} "${FILES}"
   NB_EXIT_CODE=$?
   echo "Backup for ${client} completed with code of ${NB_EXIT_CODE}"
   if [ ${NB_EXIT_CODE} -ne 0 ];then
      FINAL_EXIT=${NB_EXIT_CODE}
   fi

done

if [ ${FINAL_EXIT} -ne 0 -a ${FINAL_EXIT} -ne 71 ];then
   exit ${FINAL_EXIT}
else
   exit 0
fi
-- script ends here --

DENNIS PEACOCK
MDP
Systems & Data Protection Engineer
Acxiom Corporation
EML   dennis.peacock AT acxiom DOT com 
TEL    501-342-6232
CELL 501-343-3366
301 E. Dave Ward Drive, Conway, AR, 72032, U.S.A.
WWW.ACXIOM.COM

-----Original Message-----
From: veritas-bu-bounces AT mailman.eng.auburn DOT edu 
[mailto:veritas-bu-bounces AT mailman.eng.auburn DOT edu] On Behalf Of sruffolo
Sent: Friday, February 01, 2013 3:01 PM
To: VERITAS-BU AT MAILMAN.ENG.AUBURN DOT EDU
Subject: [Veritas-bu] BPARCHIVE using a PRE-SCRIPT

Don't you mean /usr/openv/netbackup/bparchive -p 
UNIX_uwwdwprod_file_arch1_t1_tws -s ARCHIVE -S uwpatlnbmst01 -L /tmp/logfile 
/dwprod_arch_backup 

We ran it and get the follwoing error:

root@uwwprd22:/usr/openv/netbackup/bin # ./bparchive -p 
UNIX_uwwdwprod_file_arch1_t1_tws -s ARCHIVE > Specify either a listfile or a 
list of files on the command line.
USAGE: bparchive [-p policy] [-s schedule] [-k "keyword phrase"]
           [-L progress_log [-en]] [-S master_server...]
           [-t policy_type] [-w [hh:mm:ss]]
           -f listfile | filenames
EXIT STATUS 144: invalid command usage

We were told to use a BPSTART.NOTIFY File to run a script, then use the -f to 
reference the files being arcived example -f DWARCHIVE.txt

bpnotify.start.UNIX_uwwdwprod_file_arch1_tws

Thanks for your help in advance, we are new at this and trying.

+----------------------------------------------------------------------
|This was sent by steven.ruffolo AT unisourceworldwide DOT com via Backup 
Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------


_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu 
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
***************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.
****************************************************************************

_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu

<Prev in Thread] Current Thread [Next in Thread>