I have the following script which writes the output of the scirpt in a log file in the same directory from which the script is run. I need the scipt to write the logs daily to a differnt directory with the date appended to the log on a daily basis.
The script is as follows...
. $HOME/.profile
{
echo "-----------------------------------------------------------------------------------------"
echo "***** CDR and SDR Statistics****"
date
echo "*********CDR and SDR QUEUE STATUS*****"
gs_admin | awk ' /^Queue/ {print $1,$2,$3,$4} /^cdr/ || /^sdr/ {print $1,"\t\t"$2,"\t\t"$3,"\t\t"$4}'
echo "******CWAY CROSS STATISTICS***********"
echo "name state last op busy%"
cross_stat -server | awk ' /sdr/ || /cdr/ {print $2,$7,$9,$10}'
echo ""
echo "****CPU Usage****"
uptime
}|tee -a mg_stat.log|
mailx -s "MG STAT"
xxxxx@yahoo.com
Thanks for you help...