a10 config backup for aXAPI
#!/bin/bash
#################################################
#
#scriptbyVincentyu
#createdat20140306
#a10configbackupforaXAPIversion:2.1
#
#
#################################################
A10IP="1.1.1.11.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"
forCOUNTin$A10IPdo
METHOD1="method=authenticate&username=$USER&password=$PASSWORD"
SESSION=`curl-k--data$METHOD1https://$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-khttps://$COUNT/services/rest/V2.1/?$GETHOST_M|sed-n-e's/.*\(.*\)<\/hostname>.*/\1/p'`
FILENAME="$GETHOST-$TIMENOW.tar.gz"
BACKUP_M="session_id=$SESSION&format=json&method=system.backup"
BACKUP=`curl-khttps://$COUNT/services/rest/V2.1/?$M-o$BACKUPDIR/$FILENAME`
CLOSE_M="session_id=$SESSION&method=session.close"
CLOSE=`curl-khttps://$COUNT/services/rest/V2.1/?$CLOSE_M`done
cd$BACKUPDIRecho"|-----------A10SystemBackupnotification------------------|">$LOGecho"">>$LOGls-la*.gz|awk'{print$5,$6,$7,$8,$9}'>>$LOGecho"">>$LOGecho"|------------------------------------------------------------------|">>$LOG热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下