Forum Discussion
Andy_Pelletier_
Nimbostratus
Sep 18, 2008Script to automate config backup on LTM 9.2
I would like to create/import a script and use cron to automate the creation of a .ucs file on my F5-LTM 9.2 devices.
Within the script, I would like for the newly generated file to cre...
dwertz_104302
Nimbostratus
Jul 01, 2009This is a script that I have been using for some time now. I placed it in /etc/cron.weekly and it creates a date stamped tarball of the .UCS file and FTPs it to a remote server. Been running it for well over 2 years. The only issue is when you upgrade you will have to put the script back in /etc/cron.weekly.
You will need to change the ftphost, user and password variables to reflect the FTP server you are connecting to as well as change the directory down below where the script has cd /F5/JAX1 to reflect the clients directory structure.
!/bin/bash
set the date variable
today=$(date +'%Y%m%d')
ftphost="ADD FTP IP HERE"
user="ADD FTP USERNAME HERE"
password="ADD FTP PASSWORD HERE"
run the F5 bigpipe config builder
cd /
bigpipe config save /config.ucs
Rename the config.ucs and append the date to the end
NUM=0
until [ "$NUM" -eq 5 ]
do
if [ -f /config.ucs ]
then mv config.ucs config-$today.ucs ; break
else sleep 5
fi
NUM=`expr "$NUM" + 1`
done
[[ ! -f /config-$today.ucs ]] && exit 1
Open the FTP connection and move the file
ftp -in < open $ftphost
user $user $password
bin
cd F5/JAX1
put config-$today.ucs
close
bye
EOF
Delete the backedup config file.
rm -rf config-$today.ucs
let me know if you have any questions
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
