Pages

How to auto backup configure F5 Big-ip by script


1. Tạo file backup.sh
#!/bin/bash
#Name: backup.sh
# BIG-IP Backup Script
# This script automates LTM v13 Backups and saves the files with hostname and date
# off to an FTP server
# version 1.0
# Author: thudv
# Original Date: 25/06/17
export a=`date +%y%m%d`

#rm -f /var/local/ucs/F5*

export aa=$HOSTNAME.$a.ucs
tmsh save sys ucs $aa
export file_ucs=/var/local/ucs/$aa

find /var/local/ucs/F5* -type f -mtime +7 -print
find /var/local/ucs/F5*  -type f -mtime +7 -delete

ftp -n -v  ftp_server << EOT
user username_ftp password_ftp
binary
put $file_ucs $aa

bye
EOT

2. Chmod 755 backup.sh
3. Cấu hình crontab
 crontab -e
edit: 30 23 * * * /bin/sh /home/thudv/backup.sh >/dev/null

Chú ý: Khi nâng cấp OS vào 1 phân vùng mới thì cần cấu hình lại crontab
thudinh Network and Security

No comments:

Adsense

Translate