Beruflich Dokumente
Kultur Dokumente
# Version - 1.0
# Location - /opt/splunk/bin/scripts
# Usage - This script will copy files from frozen to static frozen once
# per month
# > $SPLUNK_HOME/var/log/copyToStaticFrozen.log
##
# Change Control:
# ############################################################################
SPLUNK_HOME=/opt/splunk
. $SPLUNK_HOME/bin/scripts/archive.properties
logRotate ()
sh $SPLUNK_HOME/bin/scripts/rotateLogFile.sh copyToStaticFrozen.log
then
echo $(date +"%d/%m/%Y %H:%M:%S") Copy Failure. Previous Month\'s issue unresolved. Please
correct by inspecting netbackup and re-running checkArchive.sh
echo $(date +"%m-%d-%Y %H:%M:%S") ERROR Backup Failure - Copy Failure. Previous Month\'s issue
unresolved. Please correct by inspecting netbackup and re-running checkArchive.sh >>
/opt/splunk/var/log/splunk/audit.log
else
for((i=0;i<$static_frozen_length;i++))
do
if [ ! -d ${static_frozen[$i]}/$this_month_dir ]
then
mkdir ${static_frozen[$i]}/$this_month_dir
if [ $? != 0 ] //$? = exit status of the last command, if exit status of the previous command is not
successful, then throw error message
then
logRotate
exit 1
fi
fi
cd ${frozen[$i]}
do
if [ $index_directory != "old" ]
then
if [ ! -d ${static_frozen[$i]}/$this_month_dir/$index_directory ]
then
mkdir -p ${static_frozen[$i]}/$this_month_dir/$index_directory
fi
cd $index_directory
cd_result=$?
do
then
mv $directory ${static_frozen[$i]}/$this_month_dir/$index_directory
fi
done
if [[ $cd_result == 0 ]]
then
cd ..
fi
fi
done
done
logRotate