Forum Discussion
swo0sh_gt_13163
Jul 20, 2014Altostratus
F5 Auto backup script for SCP for V10 and 11.
Hello Guys,
I have tried looking for the subjected topic within DevCentral, but unfortunately that didn't help. (I must be doing something wrong for sure). By the way I couldn't find any script ...
What_Lies_Bene1
Jul 21, 2014Cirrostratus
There's also an iApp from Jason Rahm, here: https://devcentral.f5.com/tech-tips/articles/scheduling-big-ip-configuration-backups-via-the-gui-with-an-iapp.
Here's what I use but unfortunately no off box SCP, shouldn't be too hard to add;
Login to the device using the admin account, then:
cd /home/admin
vi bigipbackup.sh
Paste the following into the console:
!/bin/bash
/admin/home/bigipbackup.sh
UCS Files will be saved to /var/local/ucs/
SCF Files will be saved to /var/local/scf/
Create current date/time stamp variable
DATETIME="`date +%Y_%m_%d`"
Note the correct ` character must be used above,
this can be found near the top left of most keyboards
just under the [ESCAPE] key.
Uncomment the following line for troubleshooting
echo $DATETIME
Create filename variable
UCS_FILENAME="${DATETIME}_$HOSTNAME"
Uncomment the following line for troubleshooting
echo $UCS_FILENAME
Create a UCS archive with the filename specified above
The file extension will be .ucs – will be available in the GUI
tmsh save sys ucs "${UCS_FILENAME}"
Also create an SCF file with the same filename
The file extension will be .scf – won’t be available in the GUI
tmsh save sys config file "${UCS_FILENAME}.scf"
If you don’t delete these files /var will become full fairly quickly
Change the +31 value (31 days) to whatever suits you
find /var/local/ucs/ –mtime +31 -delete
EOF
Save the file and then make it executable:
chmod 711 bigipbackup.sh
Then modify the admin user’s cron table as necessary based on your needs (paste in the relevant line, not all of them);
crontab –e
@daily /home/admin/bigipbackup.sh >/dev/null 2>&1 Every day
@weekly /home/admin/bigipbackup.sh >/dev/null 2>&1 Every week
@monthly /home/admin/bigipbackup.sh >/dev/null 2>&1 Every month
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects