Skip to content

Instantly share code, notes, and snippets.

@magkopian
Last active May 30, 2016 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magkopian/b158f0adf6c82e77997057facf74b595 to your computer and use it in GitHub Desktop.
Save magkopian/b158f0adf6c82e77997057facf74b595 to your computer and use it in GitHub Desktop.
A simple script that allows the recursive download of an entire website.
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 [ULR]"
exit 1
fi
url=$1
if [[ $url != http?(s)://* ]]; then
url="http://$url"
fi
domain=`echo $url | awk -F/ '{print $3}'`
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains $domain --no-parent $url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment