Forum Discussion

francisco_1_162's avatar
francisco_1_162
Icon for Nimbostratus rankNimbostratus
Feb 12, 2008

BIGIP (LTM/GTM) Automated Backup

Just a quick question guys, is it possible to automate the backup configuration for the BIGIP. I have read a doc on askf5 to manaually backup and restore config's but i dont have time to do that. Please advise.

28 Replies

  • !/bin/bash
    host=`echo $HOSTNAME | awk -F. '{ print $1 }'`
    date=`date +%Y%m%d`
    /usr/bin/tmsh save /sys ucs backup_${host}_${date}.ucs
    /usr/bin/find /var/local/ucs -name backup_${host}_\*.ucs -mtime +30 -exec rm {} \;
    

    Save the above to a new file called /config/mybackup and add the following line to /config/startup.

    [ ! -L /etc/cron.daily/mybackup ] && ln -s /config/mybackup /etc/cron.daily/mybackup
    

    Now run the following commands to complete the configuration.

    chmod +x /config/mybackup
    ln -s /config/mybackup /etc/cron.daily/mybackup
    
    • Kevin_Davies_40's avatar
      Kevin_Davies_40
      Icon for Nacreous rankNacreous
      The mybackup script should carry over to an upgraded config and be stored in a UCS archive. If for any reason the symbolic link goes away the command in /config/startup will recreate it. The find will remove any backups older than thirty days. Just check the backup size as 30 of them may take up too much space.
    • Viv_Richards's avatar
      Viv_Richards
      Icon for Cirrostratus rankCirrostratus

      Dear Kevin,

       

      I am trying to configure automated backup by following above script. Could you please confirm where backup will be stored in this case ? /etc/cron.daily/mybackup is not directory

       

      Thanks

       

    • Samir_Jha_52506's avatar
      Samir_Jha_52506
      Icon for Noctilucent rankNoctilucent

      Find the below details

           mybackup --> Script file Name & it store inside /config/ Directory
          /var/local/ucs  --> backup file will be store
      
  • Hello,

     

    Hello, when I generate an automatic backup it shows me this error when I execute the script:

     

    Error, invalid characters in UCS file name. The dash, period, forward-slash, plus sign, and underscore are the only special characters allowed.

     

    What is the problem?

     

    Thank's

     

  • here's a python script i wrote that will create a text backup or download a ucs. i use the text backup to submit to git in order to track changes, and the ucs backup run via cron once a day for a ucs backup. run the script and it will print usage for you.

    https://github.com/nambrosch/misc-scripts/blob/master/f5backup.py

    you'll need f5's bigsuds module v1.0.4 or newer.. it can be installed using

    sudo pip install bigsuds
    or downloads here:

    https://github.com/F5Networks/bigsuds

    hope this helps!

  • There is an extra feature you can add to your daily backup, it's committing your bigip.conf to a GIT or a SVN so you can keep track of the changes that have been done, with your favorite repo browser (sourceTree for instance :)