Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Schedule automatic UCS F5 backup

Preet_pk
Altostratus
Altostratus

Hi,

I want to auto schedule F5 UCS backup. Please share the steps to configure scheduled auto backup in F5.

5 REPLIES 5

Paulius
MVP
MVP

ScottE
MVP
MVP

Hello,

What I do nightly (via cron) is create a UCS backup file and then send my backup to a remote file server.  I have a couple of devices so I make the UCS backup file have the name of the device.

backup_config.sh

#/bin/sh

HOST=`echo $HOSTNAME | awk -F . '{print $1}'`
CONFILE=`echo /shared/tmp/$HOST.ucs`
tmsh -c "save sys ucs $CONFILE"
/usr/bin/scp $CONFILE <username>@<IP of backup server>:/<backup_directory>

crontab

35 23 * * * /root/backup.sh 2>&1 > /dev/null

Normally the UCS file is written to /var/local/ucs but my config files are large so there is not always room in that directory so I write them to /shared/tmp instead.  If your configs are smaller you would not need to do that.  If they are small and you want to keep multiple on box then I would add a date to the filename in the script above but then you will also have to prune them after your retention date.

There is more in my backup script to send copies of other files for off box retention and adding them to our Rancid repository.

Please note if you add this to the root crontab then you will have to re-add it each time you upgrade since the upgrade overwrites the root crontab file.

That is a great solution but for the scheduling better use icall than cronjob as it will stay there even after tmos upgrade.

 

https://community.f5.com/t5/technical-articles/what-is-icall/ta-p/288206

ScottE
MVP
MVP

@Nikoolayy1  Thanks for the tip.  I have just converted my backup process from cron to icall.

boneyard
MVP
MVP

has your question been answered @Preet_pk ? if so please flag the answer that helped you?