#!/bin/ksh
################################################
# This script will export all OEM 13c jobs
#
# AUTHOR :
#################################################
echo -e "\n*************************************"
echo "DATE = `date`"
echo "HOSTNAME = " `hostname`
echo -e "*************************************\n"
#export WORD =''
export OMS_HOME=${OMS_HOME}
export LOG_DIR=
#$OMS_HOME/bin/emcli login -username=sysman
$OMS_HOME/bin/emcli get_reports | grep 13c > FILE
cat FILE | egrep -o '^[^,]+'|sed -e 's/^"//' -e 's/"$//' | while read -r LINE
do
echo
echo -e "**********************************************************\n"
echo -e "\nOEM JOB NAME :" $LINE
#echo $LINE | awk -F" " '{print $1}' > MYWORD
WORD1="`echo $LINE | awk -F" " '{print $1}'`"
WORD2="`echo $LINE | tr ":" " " | awk -F" " '{print $2}'`"
WORD3="`echo $LINE | tr ":" " " | awk -F" " '{print $3}'`"
echo -e "\nExporting "$WORD1 $WORD2 $WORD3 " .......\n"
$OMS_HOME/bin/emcli export_report -output_file="$LOG_DIR/${WORD1}_${WORD2}_${WORD3}.xml" -title="$LINE" -owner=SYSMAN
#echo "$OMS_HOME/bin/${WORD1}_${WORD2}_${WORD3}.xml"
done
echo -e "\n**********************************************************"
echo -e "\nSHELL Script ENDED at `date`\n"
echo -e "EXPORTED Files are =>\n"
ls -lrth $LOG_DIR/*.xml
echo -e "\nZipping above 'xml' Files.........."
gzip -f $LOG_DIR/*.xml
echo -e "\nCompleted Zipping all Files "
ls -lrth $LOG_DIR/*.gz
Refer more :
how to migrade specific OEM job to another OEM can be found below
http://chandu208.blogspot.com/2021/02/steps-to-migrate-oem-jobs-to-another-oem.html
0 comments:
Post a Comment