当前位置:  操作系统/服务器>linux

a10 config backup for aXAPI

    来源: 互联网  发布时间:2014-10-18

    本文导语:  #!/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 ...

#!/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/.*(.*).*/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_M | sed -n -e 's/.*(.*).*/1/p'` 
 FILENAME="$GETHOST-$TIMENOW.tar.gz"
 BACKUP_M="session_id=$SESSION&format=json&method=system.backup"
 BACKUP=`curl -k  https://$COUNT/services/rest/V2.1/?$M -o $BACKUPDIR/$FILENAME` 
 CLOSE_M="session_id=$SESSION&method=session.close"
 CLOSE=`curl -k https://$COUNT/services/rest/V2.1/?$CLOSE_M` done
 cd $BACKUPDIR echo "|----------- A10 System Backup notification ------------------|" > $LOG echo " " >>$LOG ls -la *.gz | awk '{print $5,$6,$7,$8,$9}' >> $LOG echo " " >> $LOG echo "|------------------------------------------------------------------|" >>$LOG

    
 
 

您可能感兴趣的文章:

 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • java命名空间javax.print.attribute.standard类mediasize.iso的类成员方法: a10定义及介绍
  • java命名空间java.awt类pageattributes.mediatype的类成员方法: a10定义及介绍


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3