Wget is a very cool command-line downloader for Linux and UNIX environments. Don't be fooled by the fact that it is a command line tool. It is very powerful and versatile and can match some of the best graphical downloaders around today. It has features such as resuming of downloads, bandwidth control, it can handle authentication, and much more. I'll get you started with the basics of using wget and then I'll show you how you can automate a complete backup of your website using wget and cron.
One of the above should do the trick for you. Otherwise, check with your Linux distribution's manual to see how to get and install packages. wget has also been ported to Windows. Users on Windows can access this website. Download the following packages: ssllibs and wget. Extract and copy the files to a directory such as C:\Program Files\wget and add that directory to you system's path so you can access it with ease. Now you should be able to access wget from your Windows command line.
Here's what each options does. The -r activates the recursive retrieval of files. The -l stands for level, and the number 1 next to it tells wget how many levels deep to go while fetching the files. Try increasing the number of levels to two and see how much longer wget takes.
Another very useful option in wget is the resumption of a download. Say you started downloading a large file and you lost your Internet connection before the download could complete. You can use the -c option to continue your download from where you left it.
Now let's move on to setting up a daily backup of a website. The following command will create a mirror of a site in your local disk. For this purpose wget has a specific option, –mirror. Try the following command, replacing http://sevenacross.com with your website's address.
When the command is done running you should have a local mirror of your website. This make for a pretty handy tool for backups. Let's turn this command into a cool shell script and schedule it to run at midnight every night. Open your favorite text editor and type the following. Remember to adapt the path of the backup and the website URL to your requirements.
You should have a copy of your website in /home/backup/YEAR/MONTH/DAY every day. For more help using cron and crontab, see this tutorial.
There's a lot more to learn about wget than I've mentioned here. Read up wget's man page.
If you have big downloads (CD/DVD-Images), i suggest to use axel instead of wget, it's a WAY faster then wget.
# Ням установить Wget – это круто.
my first ever comment…realy very gud and simple for novice user…hats off man!!!!!
how to download documen from Windos command prompt(CMD).
i hava internet plan in which i can download unlimited from 2 a.m to 8a.m.
That script will fail on the first day of every month or year because it doesn't create those folders, right?
But where are the downloades files located?
Old post, I know. But I try to ask a question anyway: How would you go about if you want to download a file using wget from a service using with Windows Authentication?