#!/bin/bash
# Copyrights (c) 2009-2012 Shoretel, Inc.
# set -x

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Function definitions
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
function verbose() {
	logger "$*"
       	echo $*
}
verbose "Starting copy kernel logs script"
mkdir -p /cf/shorelinedata/savedLogs
cp /cf/shorelinedata/Logs/kmessages* /cf/shorelinedata/savedLogs
cp /cf/shorelinedata/Logs/messages* /cf/shorelinedata/savedLogs
currentdate=$(date "+%m_%d_%y")
mv /cf/shorelinedata/savedLogs/kmessages /cf/shorelinedata/savedLogs/kmessages_$currentdate
mv /cf/shorelinedata/savedLogs/messages /cf/shorelinedata/savedLogs/messages_$currentdate
verbose "Exiting copy kernel logs script"
