Mirroring a website with wget

May 9, 2018 ops

Mirroring a website? Why would you do that in the first place? Well I used it to mirror documentation/API reference for offline usage, like on long flights. Here is a fast way of doing this with wget:

wget -r -np -N [url] &
wget -r -np -N [url] &
wget -r -np -N [url] &
wget -r -np -N [url] &

The trick is the -N switch, which downloads the file if its newer than the one on disk.