OBIEE Scripts: Script to backup catalog


Below is the script to backup the OBIEE catalog

#!/bin/bash
#
# Backup OBIEE Catalog
#


# set variables
now=`date '+%Y%m%d%H%M%S'`
dirbkp= backup path
dircat= catalog path
catalog=catalog name

# change to catalog directory. otherwise the names are too long for tar.
cd ${dircat}

# tar the directory into backup directory
tar -cvf ${dirbkp}/${catalog}_${now}.tar ${catalog}/
if [[ $? == 0 ]]; then
  echo "${now} INFO : Archival of ${catalog} successful\n"
else
  echo "${now} ERROR: Archival of ${catalog} failed\n"
  exit 1
fi

# compress the tar file
gzip ${dirbkp}/${catalog}_${now}.tar
if [[ $? == 0 ]]; then
  echo "${now} INFO : Gzip of ${catalog} successful"
else
  echo "${now} ERROR: Gzip of ${catalog} failed"
  # note: do not exit since this is the last operation
fi

# switch back to the original directory
cd -

# exit normally
exit 0


Regards,
Sreejith

Comments

Popular posts from this blog

Difference between Global Filter and Dashboard Prompt