Last active
November 10, 2021 11:08
-
-
Save marco-brandizi/1b0d8278dbf924743ac78a4e2bd6f764 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Downloads multiple files available from an HTML URL, typically the web listing of a directory, | |
# as it is rendered by many web servers. | |
# ==> Requires lftp | |
# | |
set -e | |
# Example: | |
# ./files-from-url.sh https://knetminer.com/downloads/agri-schemas/gxa/v202110/ gxa | |
# Downloads all the files in this version into the local gxa/ dir (creates it if necessary) | |
# | |
url="$1" | |
out="$2" | |
lftp="set ssl:verify-certificate no;" | |
lftp="$lftp mirror -v --continue '$url' '$out'" | |
lftp="$lftp;exit" | |
lftp -e "$lftp" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment