Skip to content

Instantly share code, notes, and snippets.

@uda
Created September 18, 2014 12:14
Show Gist options
  • Save uda/cb45ad7caf6911a99cd9 to your computer and use it in GitHub Desktop.
Save uda/cb45ad7caf6911a99cd9 to your computer and use it in GitHub Desktop.
wget tools
#!/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}
#!/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