Search This Blog

Friday 1 May 2020

Automating the BAR Backup in a script file in OBIEE 12c

Following script will be put into files and added to the cronjob in linux server to run and export archive file everyday for backup.



folderName= `date +%Y%m%d`

export SCRIPT_PATH=/obiee12c/scripts

export DOMAIN_PATH=/obiee12c/user_projects/domains/bi/bitools/bin

export EXPORT_DIR=/obishare/barbackup/migration,,,,

mkdir -p $EXPORT_DIR/$folderName

echo "Running the export archive script"

echo "Exporting............................."

$DOMAIN_PATH/ ssi $EXPORT_DIR/$folderName encryptionpassword=admin123 >> $EXPORT_DIR/$folderName/export.log

SUCCESS_COUNT=`grep "Export archive completed successfully" $EXPORT_DIR/$folderName/export.log | wc -l`

if  [ "${SUCCESS_COUNT}" -eq "l" ]


echo -e "Hi Team, \nThe export of BAR in `hostname` is completed and the export is available in ${EXPORT_DIR} \n\nThanks" | mail -s "BAR export is completed successfully in `hostname`" ${MAIL_TO}


echo -e "Hi Team, \nThe export of BAR in `hostname` is  not completed and the export log is available in ${EXPORT_DIR} \n\nThanks" | mail -s "BAR export has failed in `hostname`" ${MAIL_TO} -a $EXPORT_DIR/$folderName/export.log  ${MAIL_TO}



#Cleaning BAR files which are older than 7 days

find ${EXPORT_DIR} -name "20*" -type d  -mtime +7 -exec rm rf  {} \;


No comments:

Post a Comment

What is Oracle Database Link and How to create database link (DB Link)

Recent Posts