CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner
TayF5un
Nimbostratus
Nimbostratus

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 script.sh

5-chmod +x script.sh

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@10.128.1.246:/var/tmp/
find /shared/ucs/ -name "autoarchive*" -mtime +7 -ls >> /var/log/ucsdelete
find /shared/ucs/ -name "autoarchive*" -mtime +7 -ls -exec rm -f {} \;
Version history
Last update:
‎06-Jan-2017 07:21
Updated by:
Contributors