Well I'm back as promised. This time we are going to really geek it out with some advance features of
wget,
You are able to create an exact copy or clone of a website with wget by using the
-r and
-l aruguments for example:
wget -r -l1 http://myhomesite.com
This command will create an exact mirror of the site you specify. Including the directory structure and everything, and it will save the information in a directory called /myhomesite.com.
The
-r command means do it recursively. The
-l command tells wget how far do you want to dig into the site. If you don't specify a level it will clone the whole site which may take a long time depending on how complex the site is.
I mentioned previously that wget is useful for getting all the pictures or video files from a site well here is how to do it. It is a bit complicated but once you do it once or twice you will get it down.
wget -r -l 2 -np -A.gif http://www.myhomesite.com
The flags -np means no parent, which means reference to the parent directory is ignored. -A .gif means to accept only files with the .gif extension on it.
Suppose that you were in the middle of downloading some files and whoops the power goes out and your computer is dead what are you to do. YOU START OVER FROM FILE 1 OF 28, 344, 734 FILES. WRONG!!! wget has a solution, and this is why linux is so great. It is prepared for diesasters as long as you know the key.
wget -nc -r http://www.myhomesite.com
-nc stands for no clobber. In other words do not download files that already exists.
That is it for this post. Check back. I may post a super Ninja posting on get for those brave souls that can't get enough wget goodness.
See you next time,
The Linux Redneck