#!/bin/bash ################################################# # # script by Vincent yu # created at 20140306 # a10 config backup for aXAPI version: 2.1 # # ################################################# A10IP="1.1.1.1 1.1.1.2" USER=admin PASSWORD=a10 TODAY=`date "+%Y%m%d"` BACKUPDIR=/path/$TODAY TIMENOW=`date "+%Y%m%d%H%m"` LOG="/tmp/mail" MAILLIST="ng@ng.com.tw" for COUNT in $A10IP do METHOD1="method=authenticate&username=$USER&password=$PASSWORD" SESSION=`curl -k --data $METHOD1 https://$COUNT/services/rest/V2.1/ | sed -n -e 's/.*\(.*\)<\/session_id>.*/\1/p'` if [ ! -d $BACKUPDIR ];then mkdir -p $BACKUPDIR fi GETHOST_M="session_id=$SESSION&method=system.hostname.get" GETHOST=`curl -k https://$COUNT/services/rest/V2.1/"$GETHOST-$TIMENOW.tar.gz" BACKUP_M="session_id=$SESSION&format=json&method=system.backup" BACKUP=`curl -k https://$COUNT/services/rest/V2.1/"session_id=$SESSION&method=session.close" CLOSE=`curl -k https://$COUNT/services/rest/V2.1/"|----------- A10 System Backup notification ------------------|" > $LOG echo " " $LOG ls -la *.gz | awk '{print $5,$6,$7,$8,$9}' $LOG echo " " $LOG echo "|------------------------------------------------------------------|" $LOG
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
内蒙古资源网 Copyright www.nmgbbs.com
暂无“a10 config backup for aXAPI”评论...