Hagith
4/11/2013 - 12:54 PM

Create a mirror of a website with Wget

Create a mirror of a website with Wget

#!/bin/bash

if [[ '' == $1 || '' == $2 ]]; then
    echo "Provide domain name and URL"
    exit 1
fi

wget \
    --recursive \
    --no-clobber \
    --page-requisites \
    --html-extension \
    --convert-links \
    --restrict-file-names=windows \
    --domains $1 \
    --no-parent \
    $2