#!/bin/bash
PARABLU_PATH=/parablu
PARABLU_LOG_ARCHIVE_PATH=$PARABLU_PATH/archive
PARABLU_LOG_PATH=$PARABLU_PATH/log

LIST_OF_LOGROTATE="mongodb portal"

for i in ${LIST_OF_LOGROTATE[@]}
do
	if [[ "$i" = "mongodb" ]]
	then
   		#echo "$i is equal to mongo"
		mv $PARABLU_LOG_PATH/mongodb/*.gz $PARABLU_LOG_ARCHIVE_PATH/mongodb/

	elif [[ $i = "portal" ]]
	then
   		#echo "$i is greater than portal"
		mv $PARABLU_LOG_PATH/portal/*.gz $PARABLU_LOG_ARCHIVE_PATH/portal/
	
	elif [[ $i = "memcache" ]]
	then
		mv $PARABLU_LOG_PATH/memcache/*.gz $PARABLU_LOG_ARCHIVE_PATH/memcache/

	else
   		echo "None of the condition met"
	fi
done
