I have modified your script to include a check to limit the size of the logfile.
We don't want the logfile to fill up our disks with years of history information right ?
I've added a varialble
and then I do:
# Checking logfilesize.
RESULTS_SIZE=`stat -c %s $bcklog`
if [ "$RESULTS_SIZE" -gt 10240 ];
echo "sizelimit in effect" >>$bcklog
mv $bcklog $tmplog
echo "Logfile exceeded 10 MB Limit. Creating new logfile and transfer">>$bcklog
echo "the last 10 lines from the old log to the new one">>$bcklog
tail -n 10 $tmplog >>$bcklog
and the end of the dbcopy command.