F5 Ltm Backup Script
Hello Experts,
Reference:- https://devcentral.f5.com/wiki/AdvDesignConfig.LTM_Backup_Shell_Script.ashx I have taken reference from above URL and modified and have used below script to take backup of F5 , however the backup is not working/coming to FTP. I am not much of a script guy , so can anyone suggest me, what i am doing wrong in here. Also i want to know at which time this script will execute. Much appreciated.
!/bin/sh -x Name: backup_cron_scriptv10.sh BIG-IP Backup Script This script automates LTM v10 Backups and saves the files with hostname and date off to an FTP server version 1.0 Author: Bhattman Original Date: 01/07/10 Backup your config in ucsb config save /var/tmp/BIG-IP_backup export a=
date +"%y%m%d"
export aa=$HOSTNAME.$a.ucs
export b=/var/tmp/$aa
mv /var/tmp/BIG-IP_backup.ucs $b
Backup the SSL Certs
tar -cf /var/tmp/certs.tar /config/ssl export ff=$HOSTNAME.$a.certs.tar export f=/var/tmp/$ff mv /var/tmp/certs.tar $f
copy your crontab information - it can be other files as wellexport c=$HOSTNAME.$a.crontab export cc=/var/tmp/$c cp /etc/crontab $cc
export MName=<192.168.1.100/F5> export Log=/var/tmp/log.bigip
ftp username and passwordexport UserName=admin export UserPassword=admin
export Machine1f2=$aa export Machine1f3=$c export Machine1f4=$ff
ftp command that sends the files over to ftp serverftp -nvd ${MName} <<-END 1>&2 > ${Log} user ${UserName} ${UserPassword} bin put ${b} ${Machine1f2} put ${cc} ${Machine1f3} put ${f} ${Machine1f4} quit END
removes the copied files after pushrm -f ${b} rm -f ${cc} rm -f ${f} RTN_CODE=$?
exit $RTN_CODE