Forum Discussion

Techgeeeg_28888's avatar
Techgeeeg_28888
Icon for Nimbostratus rankNimbostratus
Dec 04, 2013

Automatic configuration backup on LTM box

Hi Everyone, I was looking for a possible way if my F5-LTM box can take the configuration backup after every 24hours and stores it on the F5-Box with date. Also if it is possible that the box sends this backup to a FTP server or creates an email and send's it to a configured e-mail id.

 

Regards,

 

18 Replies

  • Hi Guys, Coming back to this same thread I have come across a point where there are multiple backup servers and the health of them should be checked and one of them will be on priority till it is up how can this be integrated to the above scripting.

     

    Regards,

     

  • Hi,

    Here is the newest version for your script 🙂

    !/bin/bash
    $DATE=`date "+%m_%d_%y"`
    
    tmsh show cm failover-status | grep ACTIVE
    
    if [ "$?" = "0" ] ; then
        Here we create the ucs archive
        tmsh save sys ucs $DATE
    
        Here we copy it to your server
        scp /var/local/ucs/$DATE user@ip_server:path
    fi
    

    Let me know if it fits your needs.

  • Hi Thomas,

     

    Super newbie question. 1. How to write the given script? and where to save it? 2. Once the script is written, do I need to put that in cron for cyclic execution?

     

    Sorry for such question.

     

    Thank you, Cheers!

     

  • Hi,

    You can write this script and save it wherever you want. You can do it with your favorite text editor (notepad, vim, nano...)

    To execute this script you have 2 choices, the first one is manually and the best one is using cron.

    Here is an example of what you have to write into your crontab file :

    0   1 * * * "tmsh save sys ucs my_file_name"
    15  1 * * * "scp /var/local/ucs/my_file_name user@your_destination_server:path  
    
  • Hi,

    We are trying to automate the backup using external monitor.Tried using the below script.Looks like monitor is marking the pool as UP but the content(UCS)is not getting copied over to the destination. Please suggest.

    !/bin/bash remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)

    IP=

    echo ${1} | sed 's/::ffff://'
    PORT=${2} PIDFILE="/var/run/
    basename ${0}
    .${IP}_${PORT}.pid"

    kill of the last instance of this monitor if hung and log current pid

    if [ -f $PIDFILE ] then kill -9

    cat $PIDFILE
    > /dev/null 2>&1 fi echo "$$" > $PIDFILE tmsh save sys ucs today && scp /var/local/ucs/today.ucs user@${IP}:/var/tmp/backups/ && ssh user@${IP} ls /var/tmp/backups |grep "today" 2>&1 > /dev/null

    mark node UP if expected response was received

    if [ $? -eq 0 ] then echo "UP" fi rm -f $PIDFILE exit