Skip to content

Instantly share code, notes, and snippets.

@Overbryd
Created May 24, 2016 06:55
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 Overbryd/94fe9aeec0665ad9c369362569d599af to your computer and use it in GitHub Desktop.
Save Overbryd/94fe9aeec0665ad9c369362569d599af to your computer and use it in GitHub Desktop.
Mirror a complete website with wget
#!/bin/bash
# Mirror a complete website with wget
function mirror-website() {
local url=$@
local domain=`expr "$url" : '^http[s]*://\([^/?]*\)'`
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