Linux wget Auto Login and Backup Database

Source: Internet
Author: User

#!/bin/bash# This is a code originally intended to use the automatic backup data, due to the test process has been unable to connect problems, resulting in the inability to test, # then finally gave up the code of the further development, but the record is still necessary Login_url='Xxxxxxxxx:2083/login/?login_only=1'Cookie_file='Cookies'Login_params="--save-cookies $cookie _file--keep-session-cookies--post-data= ' user=z&pass=q '--referer= ' xxxxxxxx:2083/' --no-check-certificate"Download_params="--save-cookies $cookie _file--keep-session-cookies--load-cookies $cookie _file--referer= ' xxxxxxx:2083/{{ Session_id}}/frontend/paper_lantern/backup/index.html '--no-check-certificate"Backup_url='xxxxxxxx/{{session_id}}/getsqlbackup/z_zengjf.sql.gz'Login() {    wget$login _params"$login _url"-O-Exit #return_html=$(wget$login _params"$login _url 2>/dev/null"-O-) session_id=$(Echo "$return _html"|awk-f/'{print $}')}download () {URL=$(Echo "$backup _url"|sed-R"s/\{\{session_id\}\}/$session _id/") Params=$(Echo "$download _params"|sed-R"s/\{\{session_id\}\}/$session _id/") file_name="blog_db_$ (date + '%y%m%d%h%m%s '). sql.gz"    wget$params"$url"-O $file _name}clean () {RM-f $cookie _file}Login#download #clean

Linux wget Auto Login and Backup Database

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.