Forum Discussion
Schedule Auto Backup of LTM UCS
Hi Team,
We would like to schedule auto backup of our LTM UCS file to local computer, please let us know to how to do?
Running Version BIG-IP 11.6.1 Build 1.0.326 Hotfix HF1
7 Replies
- Samir_Jha_52506
Noctilucent
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
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,dsa key
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_7991
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. -f1
tmsh 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
- wndak_159397
Nimbostratus
DATE=date +%Y%m%d
hostname=uname -n |cut -d. -f1
tmsh save sys ucs $DATE
sleep 5
ftp -n xx.xx.xx.xx << EOF
user xxxxxx "xxxxx"
binary
cd \Users\xxxxx\Desktop\Newfolder
put "$DATE.ucs"
bye
End-Of-Session
EOF
- Senthil_7991
Nimbostratus
Still, am having same issue, Please explain step by step.
Active:In Sync] tmp bash -x f5backup.sh
- =date +%Y%m%d f5backup.sh: line 2: =date: command not found
- hostname=uname
- -n
- cut -d. -f1 f5backup.sh: line 3: -n: command not found
- tmsh save sys ucs Syntax Error: enter ucs identifier
- ftp -n xx.xx.xx.xx
^C+ user xxxxxx xxxxxxx f5backup.sh: line 11: user: command not found + binary f5backup.sh: line 12: binary: command not found + cd usersxxxxxxdesktopnewfolder f5backup.sh: line 13: cd: usersxxxxxxdesktopnewfolder: 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 Active:In Sync] tmp
Active:In Sync] tmp chmod +x f5backup.sh Active:In Sync] tmp ./f5backup.sh ./f5backup.sh: line 2: +%Y%m%d: command not found ./f5backup.sh: line 3: -n: command not found Syntax Error: enter ucs identifier ^C./f5backup.sh: line 11: user: command not found ./f5backup.sh: line 12: binary: command not found ./f5backup.sh: line 13: cd: usersxxxxxdesktopnewfolder: No such file or directory ./f5backup.sh: line 14: put: command not found ./f5backup.sh: line 15: bye: command not found ./f5backup.sh: line 16: End-Of-Session: command not found Active:In Sync] tmp Active:In Sync] tmp
- wndak_159397
Nimbostratus
DATE=`date +%Y%m%d`
hostname=`uname -n |cut -d. -f1`
Check following article that would be helpful to you.
K13418: Archiving UCS files using the logrotate and crontab utilities (11.x - 13.x) https://support.f5.com/csp/article/K13418
- WalterC_335367
Nimbostratus
I modified the script to transfer the file to our SFTP server and it worked but how do I get it to send the password for the user I created on the SFTP server?
[root@CMWF5V01P:Active:In Sync] config ./backup.sh Saving running configuration... /config/bigip.conf /config/bigip_base.conf /config/bigip_user.conf Saving Ethernet mapping...done Saving active configuration... /var/tmp/CMWF5V01P-20181030.ucs is saved. Connecting to 10.100.1.251... CMWF5V01P@10.100.1.251's password:
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