How to Automate Backup ucs file

Hi All,

Please let me know if we can automate daily backup of ucs file in LTM 11.x version by using irule or by using any other options.

Thanks & Regards, Sheela Narayan

Sheela, You can yes, using an iApp.

See: Backup Scheduler iApp

Or a simple crontab entry… Or a 3 line script from a central server…

What’s your requirements? Each option has certain advantages (And disadvantages)

H

iCalls is what you need. Here is an iApp template that configures periodic backup using an iCall. DevCentral

Simply unzip the “f5.archiving.v1.0.1.tmpl” iApp template, import it to BigIP GUI under iApps/Templates. Then create an iApp service using the newly imported template. You will be impressed.

Also read this great article about performing backups with iCalls. Jason’s Article.

A cron job configuration is not saved to the UCS but an iCall is saved as well as config synched to peer.

Here is where you can read about iCalls.

If you were to create an iCall by hand you would create two things, an iCall handler and an iCall script, here are examples:

sys icall handler periodic f5.config_backup {
    first-occurrence 2013-06-26:08:18:00
    interval 86400
    script f5.config_backup
}


sys icall script f5.config_backup {
    app-service none
    definition {
        Set Current Date/Time for Filename
        set cdate [clock format [clock seconds] -format "%Y%m%d%H%M%S"]
        Pull hostname from config for Filename
        set host [tmsh::get_field_value [lindex [tmsh::get_config sys global-settings] 0] hostname]
        Create Temp Directory
        set tmpdir [exec mktemp -d /var/tmp/f5backup.XXXXXXXXXX]
        Set Filename Root
        set fname "f5backup-$host-$cdate"
        Export UCS
        tmsh::save /sys ucs $tmpdir/$fname

    }
    description none
    events none
}

HTH

Thanks John

Maybe a bit late, but I’m adding an official F5 solution link here. Might be useful for somebody:

K13418: Archiving UCS files using the logrotate and crontab utilities (11.x - 12.x) myF5

Jozef