1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| adrci_show_policy.sh
#!/bin/sh
for ADRHOME in `adrci exec="show home"`
do
if [ $ADRHOME = "ADR" -o $ADRHOME = "Homes:" ]
then
continue;
fi
echo $ADRHOME
adrci <<EOF
set home $ADRHOME
show control
purge
exit
EOF
done
adrci_set_policy.sh
#!/bin/sh
SHORTP_POLICY=24
LONGP_POLICY=24
SCRIPTNAME=$(basename $0)
function usage {
echo "usage : ${SCRIPTNAME} [--sp <hours> --lp <hours> ]"
echo "exemple : ${SCRIPTNAME} --sp 72 --lp 720"
}
if [ $# -lt 2 ]; then usage; exit 1; fi
while [ "$1" != "" ]; do
case $1 in
--sp ) shift
export SHORTP_POLICY=$1
;;
--lp ) shift
export LONGP_POLICY=$1
;;
-h|--help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done
for ADRHOME in `adrci exec="show home"`
do
if [ $ADRHOME = "ADR" -o $ADRHOME = "Homes:" ]
then
continue;
fi
echo $ADRHOME
adrci <<EOF
set home $ADRHOME
show control
set control (SHORTP_POLICY = ${SHORTP_POLICY})
set control (LONGP_POLICY = ${LONGP_POLICY})
show control
purge
exit
EOF
done |
Partager