Friday, January 16, 2015

Automated F5 Configuration Backups

I've been using F5 LTMs for years, and a while back I decided to create a script to automate the configuration backup.  Today I added that backup source code to my GitHub account to share the love for anyone that's interested.

Here's the overview of what it does:

1.  Connect to each device, create a .ucs file, download the .ucs file and the bigip.conf file
2.  Removes local .ucs files older than 30 days
3.  Commits bigip.conf files to Subversion
4.  Send notification email if any errors are encountered

The script has the following requirements:

* List of F5 LTM IP addresses that you want included in the backup
* SSH key-based authentication established for each target F5 device
* Email address to recieve alerts when backups fail
* SVN repository to hold the backups (this could be converted to git fairly easily)

Its been running flawlessly for me for several years now.  Check it out and let me know what you think.


  1. This is a great too, thanks for sharing. By far the best F5 backup solution I have found. One change I made was to add another -o User=F5backupuser to your SSH_OPTS. Also if the last octet of the F5's IP is single, ie .2 or .3, the script fails silently. Adding a .02 or .03 resolves that issue.

    Enhancements I am working on is adding qkviews and changing the targets to file to be IP HOST and using the HOST variable for file naming.

    Thanks again!

  2. Thanks for the feedback! I see the issue. I originally wrote this about 3 years ago so I made some updates before I added it to my github account, which is where the octet issue came from.

    I can make your updates or you can submit a pull request and I'll merge it in.

  3. GREAT topic! It is really interesting to read from the beginning & I would like to share your blog to my circles, keep sharing… DevOps Online Training
    DevOps Training
    DevOps Online Training