Veritas-bu

[Veritas-bu] Is there any command to deactive all jobs...

2004-08-05 12:28:41
Subject: [Veritas-bu] Is there any command to deactive all jobs...
From: Mark.Donaldson AT cexp DOT com (Mark.Donaldson AT cexp DOT com)
Date: Thu, 5 Aug 2004 10:28:41 -0600
OK - here's a ksh script pair that'll record the state of the policies &
disable the active ones.  The other script will read the file where the
previous values are stored & reenable the formerly enabled ones...

$ cat policy_disable_all

#!/bin/ksh

export PATH=$PATH:/usr/openv/netbackup/bin/admincmd

STORE=/var/tmp/policy_state_DO_NOT_DELETE

if [ -f $STORE ]
then
  echo "## WARNING:"
  echo "## stored policy values found."
  echo "## Delete \"$STORE\" if you"
  echo "## intend to run this script again before"
  echo "## running the re-enabling script."
else
  echo "## Recording current policy states."
  for pl in `bppllist`
  do
    bppllist $pl -U | awk '$1=="Active:" {print "'$pl'",$2}'
  done > $STORE

  echo "## Disabling policies"
  for pl in `awk '$2=="yes" {print $1}' $STORE`
  do
    echo "## Disabling $pl"
    bpplinfo $pl -modify -inactive
  done
fi
echo "## Done"
exit

$ cat policy_reenable_all

#!/bin/ksh

export PATH=$PATH:/usr/openv/netbackup/bin/admincmd

STORE=/var/tmp/policy_state_DO_NOT_DELETE

if [ ! -f $STORE ]
then
  echo "WARNING: past state file not found. \"$STORE\""
else
  echo "## Enabling policies"
  for pl in `awk '$2=="yes" {print $1}' $STORE`
  do
    echo "## Enabling $pl"
    bpplinfo $pl -modify -active
  done
fi
[ -f $STORE ] && rm -f $STORE && echo "## Deleted: $STORE"
echo "## Done"