Se hace uso de la variable getopts y $OPTARG:
#!/usr/bin/ksh
set -x
export DATE=`date "+%d%m%y"`
export ORACLE_HOME=/oracle/product/
export DB_CAT=rcat
while getopts d:p: DATA
do
case $DATA in
d) DB_TARGET=$OPTARG
;;
p) PASS=$OPTARG
;;
*) usage
;;
esac
done
usage()
{
clear
echo "Usar: rman_back.sh -d
echo ""
exit 2
}
$ORACLE_HOME/bin/rman target=system/$PASS@$DB_TARGET catalog rcat/xxxxxx@rcat cmdfile=/scripts/full_backup_$DB_TARGET.rcv log=/b1/$DB_TARGET/rman_backup_$DB_TARGET.$DATE.log
No hay comentarios.:
Publicar un comentario