#!/bin/bash
#                                                                                       #
# SCRIPT: blukrypt_backup.sh                                                           #
# DATE:   05-May-2017                                                                   #
# REV:    1.0                                                                           #
# DEVELOPED BY: Parablu Systems                                                         #
# DEVELOPER: Vaibhav K
# PURPOSE: Contains all the utility functions for bluvault Installation                 #
# PLATFORM: Ubuntu                                                                      #


PARABLU_COMPONENT_SCRIPT_PATH=../config/parablu_component_config.sh
PARABLU_CONFIG_SCRIPT_PATH=../config/parablu_config.sh

source $PARABLU_COMPONENT_SCRIPT_PATH
source $PARABLU_CONFIG_SCRIPT_PATH


                mkdir -p $BACKUP_PATH/Initial_backup/$BLUKRYPT
                mkdir -p $BACKUP_PATH/Initial_backup/$PARACLOUD_SEARCH
		mkdir -p $BACKUP_PATH/Initial_backup/PCB_REPO
                

                service tomcat-pcb1 stop

                mv $TOMCAT_PG1_PATH/webapps/$BLUKRYPT/*  $BACKUP_PATH/Initial_backup/$BLUKRYPT
                mv $TOMCAT_PG1_PATH/webapps/$PARACLOUD_SEARCH/*  $BACKUP_PATH/Initial_backup/$PARACLOUD_SEARCH
		mv $TOMCAT_PG1_PATH/$PG_REPO_NAME/*  $BACKUP_PATH/Initial_backup/PCB_REPO

		service tomcat-pcb1 start

        
	        service tomcat-job1 stop

                mkdir -p $BACKUP_PATH/Initial_backup/$BLUKRYPT_JOB
		mkdir -p $BACKUP_PATH/Initial_backup/JOB_REPO
                mv $TOMCAT_JOB1_PATH/webapps/$BLUKRYPT_JOB/*  $BACKUP_PATH/Initial_backup/$BLUKRYPT_JOB
		mv $TOMCAT_JOB1_PATH/$PG_REPO_NAME/*  $BACKUP_PATH/Initial_backup/JOB_REPO
	
		service tomcat-job1 start

