Wrote a simple Linux shell to download files

Source: Internet
Author: User

#!/bin/SH for((i=0; i< -; i=i+1)); Do# Use the spider to detect if the requested resource exists and write the result of the request to a filewget--spider--http-user=username--http-password=passwd--no-check-certificate-e"Https_proxy=http://url:port"FileURL &>SpiderResult.txt # Read the contents of the file into a variable ABC="' Cat/home/yxf/spiderresult.txt '"# Read the last 6 characters of the variable, and if it is exists the file to be downloaded is present, in which case a file download request can be initiated Okindex=${ABC: (-7):6}    if["$okIndex"="exists"]; Then# File Downloadwget-p/download/billdownload--http-user=username--http-password=passwd--no-check-certificate-e"Https_proxy=http://url:port"FileURL Breakfi# If the file does not exist, put the current thread to sleep for 20 minutesSleep20m Done

Wrote a simple Linux shell to download files

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.