Backup F5 archive to backup server daily

Problem this snippet solves:

When you want to create auto archive file and send this file to remote server automatically or manually, you should this scripts.

How to use this snippet:

1- Connect F5 as a root

2- open text editor such as "vi"

3- copy the script

4- save the

5-chmod +x

Code :

#! /bin/bash
time=`date +%Y_%m_%d_%H%M`
unit=`tmsh list sys global-settings one-line | grep -oP '(?<=hostname\s)[^\.]*'`
tmsh save /sys ucs /shared/ucs/autoarchive_${unit}_${time}.ucs passphrase 'topsecret'
scp /shared/ucs/autoarchive_${unit}_${time}.ucs tayfunftp@
find /shared/ucs/ -name "autoarchive*" -mtime +7 -ls >> /var/log/ucsdelete
find /shared/ucs/ -name "autoarchive*" -mtime +7 -ls -exec rm -f {} \;
Published Jan 06, 2017
Version 1.0

Was this article helpful?

No CommentsBe the first to comment