Quantcast
Channel: Sameer Shaik. B.E,M.S,M.B.A,P.M.P,C.S.M
Viewing all articles
Browse latest Browse all 191

Hyperion App backups - Unix script

$
0
0

To backup all the apps in Hyperion:


#!/bin/ksh
####################################################################
#                                                                  #
#  Who          When            What                               #
#  ----------------------------------------------------------------#
#  shaiks       24-JUL-17       Created
#                                                                  #
#                                                                  #
####################################################################
#
#set -x

date1=`date +'%d%b%y'`
date2=`date +'%d%b%Y%H%M%S'`

#Set Parameters
if [ ${#} -ne "1" ];then
        echo " Please pass the environment name"
exit 0
else
        ENV=$(echo $1 |tr "[:lower:]""[:upper:]" )
fi

. /home/hypadm/EPM$ENV.env
if [ $ENV == "DEV" ] || [ $ENV == "TST" ];then
SCRIPTS_DIR=/PATH/scripts
else
SCRIPTS_DIR=/PATH$1/scripts
fi
APP_BACKUP_DIR=/HYP/$ENV/APP_BKP
BACKUP_DIR=$APP_BACKUP_DIR/$date2
LOG_FILE=$BACKUP_DIR/$(basename "$0" | cut -d \. -f1)_$ENV_$date2.log

mkdir -p $BACKUP_DIR
#echo $ENV $date2 $APP_BACKUP_DIR/$date2/ $BACKUP_DIR $APP_BACKUP_DIR $SCRIPTS_DIR $LOG_FILE
Utility.sh $SCRIPTS_DIR/${ENV}_APP_BACKUP_ALL.xml -b $BACKUP_DIR/  > $LOG_FILE 2>&1

#Verify Success or Failure
status=$(tail -n1 $LOG_FILE | grep -i success | awk '{print $4}')
if [[ $status == "Success" ]];then
echo $status | mailx -s "Hyperion $ENV App Backup completed Successfully" sshaiksameer@shaiksameer.com
else
uuencode $LOG_FILE $LOG_FILE | mailx -s "Hyperion $ENV App Backup failed - verify the attached log" shaiksameer@shaiksameer.com

#Delete App backups older than 45 days.
find $APP_BACKUP_DIR -prune -type d -mtime +45 -exec rm -rf {} \;







cat APP_BACKUP_ALL.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package>
    <LOCALE>en_US</LOCALE>
    <User name="admin" password="Your password here"/>
    <Task>
        <Source type="Application" product="BPMA" project="Foundation" application="EPM Architect"/>
        <Target type="FileSystem" filePath="/EPMA-EPM Architect"/>
        <Artifact recursive="true" parentPath="/" pattern="*"/>
    </Task>
    <Task>
        <Source type="Application" product="HUB" project="Foundation" application="Shared Services"/>
        <Target type="FileSystem" filePath="/HSS-Shared Services"/>
        <Artifact recursive="true" parentPath="/" pattern="*"/>
    </Task>
    <Task>
        <Source type="Application" product="HAVA" project="Reporting and Analysis" application="Reporti
ng and Analysis"/>
        <Target type="FileSystem" filePath="/RnA-Reporting and Analysis"/>
        <Artifact recursive="true" parentPath="/" pattern="*"/>
    </Task>
    <Task>
        <Source type="Application" product="ESB" project="EssbaseCluster-1" application="EssbaseCluster
-1"/>
        <Target type="FileSystem" filePath="/ESB-EssbaseCluster-1"/>
        <Artifact recursive="true" parentPath="/" pattern="*"/>
    </Task>
    <Task>
        <Source type="Application" product="HP" project="Planning" application="SHAIK"/>
        <Target type="FileSystem" filePath="/HP-SHAIK"/>
        <Artifact recursive="true" parentPath="/Configuration" pattern="*"/>
        <Artifact recursive="true" parentPath="/Global Artifacts" pattern="*"/>
        <Artifact recursive="true" parentPath="/Plan Type" pattern="*"/>
        <Artifact recursive="true" parentPath="/Security" pattern="*"/>
    </Task>
       <Task>
        <Source type="Application" product="CALC" project="Foundation" application="Calculation Manager
"/>
        <Target type="FileSystem" filePath="/CALC-Calculation Manager"/>
        <Artifact recursive="true" parentPath="/" pattern="*"/>
    </Task>
</Package>


Viewing all articles
Browse latest Browse all 191

Trending Articles