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

Problem this snippet solves:

A script that can backup F5 configurations, runs daily, and FTP's the backup to a defined remote server. You will need to change the ftphost, user and password variables to reflect the FTP server you are connecting to as well as change the directory where the script has "cd /F5/JAX1" to reflect the clients directory structure.

Cron job setup

To ensure a daily backup, save the script source below in /etc/cron.daily:

Code :

#!/bin/bash
# set the date variable
today=$(date +'%Y%m%d') 
ftphost="ADD FTP IP HERE"
user="ADD FTP USERNAME HERE"
password="ADD FTP PASSWORD HERE"
#run the F5 bigpipe config builder
cd /
bigpipe config save /config.ucs
#Rename the config.ucs and append the date to the end
NUM=0
until [ "$NUM" -eq 5 ]
do
if [ -f /config.ucs ]
then mv config.ucs config-$today.ucs ; break
else sleep 5
fi
NUM=`expr "$NUM" + 1`
done
[[ ! -f /config-$today.ucs ]] && exit 1
#Open the FTP connection and move the file
ftp -in <
Comments
CMHC_179558
Nimbostratus
Nimbostratus
Hello Gurus I'm trying to run this script and getting several errors, here is the output: [root@DEVADC1:Active] cron.daily chmod 775 f5backup.sh [root@DEVADC1:Active] cron.daily . ./f5backup.sh : command not found : No such file or directory Error, invalid characters in UCS file name. The dash, period, forward-slash, plus sign, and underscore are the only special characters allowed. Error during config save. Unexpected Error: UCS saving process failed. bash: ./f5backup.sh: line 32: syntax error: unexpected end of file Any ideas?
Mrinalranjan_17
Nimbostratus
Nimbostratus
is this issue resolved . can someone tell how come following error can be avoided
ogozar_275571
Nimbostratus
Nimbostratus

What is the solution to this problem?

 

Version history
Last update:
‎12-Mar-2015 16:27
Updated by:
Contributors