This script tars the log files and send them to an ftp server .. Before Using This backup script you have to manully set log switch time to midnight and make a cronjob for executing this script after midnight time like 24:01
!#/bin/bash
. /opt/CPshrd-R55/tmp/.CPprofile.sh (For NGX version this path /opt/CPshrd-R60/tmp/.CPprofile.sh)
DATE=`date +%Y-%m-%d`
LOGS=$FWDIR/log
LOGFILE=$LOGS/”$DATE”_235900.log
tar cvf—absolutenames $LOGFILE.tar.gz “$LOGFILE” 2> /dev/null
ZIP=$DATE”_235900.log.tar.gz”
ftp_put ()
{
FTPIP=”xxx.xxx.xxx.xxx”
DIR=”xxx.xxx.xxx”
USER=”xxx”
PASS=”xxx”
ftp -n $FTPIP < < EOF
user $USER $PASS
bin
cd $DIR
lcd /opt/CPfw1-R55/log
put $ZIP
bye
EOF
}
exit 0
2 comments:
Thanks for that , we used here on NG R65 and works without any problem.
Good fill someone in on and this mail helped me alot in my college assignement. Say thank you you on your information.
Post a Comment