This time I present a simple yet powerful solution: A bash script that automates the process of backing up F5 configurations to an SMB share.

I was doing it from an external machine via SSH and SCP, but i have decided to run it locally in the F5 system:

#!/bin/bash

DEVICE_NAME="bigip1"
SHARE="//my_fileserver/myshare"
SHARE_PATH="F5_backups"
SHARE_CREDENTIALS_FILE="/opt/scripts/.smbcredentials.txt"


TODAY=$(date +%Y%m%d)
LOCAL_FILE="${DEVICE_NAME}_$TODAY"
LOCAL_PATH="/dev/shm"

tmsh save /sys ucs $LOCAL_PATH/$LOCAL_FILE > /dev/null

cd $LOCAL_PATH
smbclient -A $SHARE_CREDENTIALS_FILE $SHARE -c "cd $SHARE_PATH; put $LOCAL_FILE.ucs" 2> /dev/null
cd -

rm $LOCAL_PATH/$LOCAL_FILE.ucs

It needs and smb credentials file (of a user with permissions in the SMB share) with the format showed below:

username=myuser
password=mypassword
domain=mydomain.com

(the domain in case it is necessary)

Just configure the execution in the cron (for example weekly, or daily) and the backups are ready for any disaster