Forum Discussion
Schedule Auto Backup of LTM UCS
There are many ways to take F5 backup regularly or based on time frame. Either go via some script(bash, perl,etc) or existing iAPP setup. Its up to your choice how you gonna to make it.
Option1: Bash Script
Its via SFTP and key authentication. You need to first create a
dsa key to use for authentication to your SCP/SFTP server. Then put the script in a file named /config/backup and create a chron job using this, chmod +x /config/backup; ln -s /config/backup /etc/cron.daily/backup
!/bin/bash
Set variables for UCS file name
dt=`date +%Y%m%d`
hostname=`uname -n |cut -d. -f1`
DDIR=/var/tmp
SFTPhost=
Delete old ucs file created by this script
rm $DDIR/$hostname*.ucs
cd /config
tmsh save /sys config
Create configuraiton archive
tmsh save /sys ucs $DDIR/$hostname-$dt.ucs
Send to admin server via SFTP
cd $DDIR
sftp -oIdentityFile=/config/sftp_dsa $hostname@$SFTPhost<< EOF
cd $hostname
put $hostname-$dt.ucs
quit
EOF
Option 2(via iApp) Please go through below link
- Senthil_7991Jan 09, 2018
Nimbostratus
Hi Team, I would know where should put my username/ password details for SFTP, Please explain some more clearly.
I created this below script and put inside but having issue
!/bin/bash$DATE=
hostname=date +%Y%m%d
Here we create the ucs archiveuname -n |cut -d. -f1tmsh save sys ucs $DATE
Here we do the same with ftpftp -n xx.xx.xx.xx
user xxxxxx "xxxxx" binary cd \Users\xxxxx\Desktop\Newfolder put "$DATE.ucs" bye End-Of-Session
Getting this below error
++ date +%Y%m%d + =20180109 f5backup.sh: line 2: =20180109: command not found ++ uname -n ++ cut -d. -f1 + hostname=XXXXXXXXXX + tmsh save sys ucs Syntax Error: enter ucs identifier + ftp -n XXXXXXX
^C+ user XXXXXX XXXXXX f5backup.sh: line 11: user: command not found + binary f5backup.sh: line 12: binary: command not found + cd UsersxxxxxxxDesktopNewfolder f5backup.sh: line 13: cd: UsersxxxxxxxxDesktopNewfolder: No such file or directory + put .ucs f5backup.sh: line 14: put: command not found + bye f5backup.sh: line 15: bye: command not found + End-Of-Session f5backup.sh: line 16: End-Of-Session: command not found
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com