Created
September 18, 2014 12:14
-
-
Save uda/cb45ad7caf6911a99cd9 to your computer and use it in GitHub Desktop.
wget tools
This file contains 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
#!/bin/bash | |
URL=$1 | |
DOMAIN=$2 | |
WAIT=$3 | |
if [ "${URL}" == "" ] || [ "${DOMAIN}" == "" ] | |
then | |
echo "Usage: $0 URL DOMAIN" | |
exit 1 | |
fi | |
if [ -d "${DOMAIN}" ] | |
then | |
echo Directory already exists, I do not override | |
exit 2 | |
fi | |
if [ "${WAIT}" == "" ] | |
then | |
WAIT=2 | |
fi | |
mkdir -p ${DOMAIN} | |
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --level=5 --domains ${DOMAIN} --no-parent ${URL} |
This file contains 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
#!/bin/bash | |
DOMAIN=$1 | |
WAIT=$2 | |
if [ "${DOMAIN}" == "" ] | |
then | |
echo You need to give me a domain | |
exit 1 | |
fi | |
if [ "${WAIT}" == "" ] | |
then | |
WAIT=2 | |
fi | |
if [ -d "${DOMAIN}" ] | |
then | |
echo Directory already exists, I do not overwrite | |
else | |
mkdir -p ${DOMAIN} | |
fi | |
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --max-redirect 0 -w ${WAIT} --domains ${DOMAIN} --no-parent ${DOMAIN} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment