A10 config backup for Axapi_linux shell

Source: Internet
Author: User
Tags curl
#!/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 $A 10IP do method1= "Method=authenticate&username= $USER &password=$ PASSWORD "session= ' curl-k--data $METHOD 1 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 _m | Sed-n-E ' s/.*\ (. *\) <\/hostname>.*/\1/p ' filename= ' $GETHOST-$TIMENOW. tar.gz "backup_m=" session_id= $SESSION & Amp;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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.