Wget - FTP command line download

Posted by Unknown Sabtu, 30 Januari 2010 0 komentar
Introduction
A year and a half ago I was looking into a way to automate the downloading of a file from FTP and if the download was interrupted, I wanted some way of resuming the download where it had left off. This is important in situations where you have low or unreliable internet bandwidth. If you are downloading a large file and you are disconnected from the internet for some reason, you don't want to start your download again from the beginning.

Previously I had been using the AutoIt built-in function InetGet(). It uses Internet Explorer's download feature and that works fine in perfect conditions, but if there's one slight interruption, it stops. Crucially there's no resume feature available for InetGet().

Another major requirement was that the solution be free of any cost, so I only looked for open source and freeware products.

At first I did some research on the web that told me that resuming downloads requires the owner of the FTP site to have switched on the capability to resume. This was not what I wanted to hear, that is something out of my control. But I didn't fully believe it either, dedicated FTP software like WS_FTP will resume downloads. Of course a Windows GUI tool was not useful to me, I wanted a command line tool so that I could create an automated download process.


Wget
I came across Wget, an open source program, originally a tool from the Unix/Linux world, a Windows command line version is available and works extremely well! It has a 'continue' feature, this will continue (resume) downloads if broken.

It's a single exe file of about 400K. You can download it from here:

To use Wget you need to open a command window CMD. Like most command line tools you can get a list of options/parameters at the command line itself, here's what you enter:
wget --help

You can also find a list of command line options/parameters here:

Here's an example of using Wget to download a single file from an FTP site where a user name and password is required:
wget -c --ftp-user=michael --ftp-password=abc123 ftp://192.168.0.3/file.zip

What does it all mean? The command wget is followed by four parameters, each with a space between them. The above should be entered as one continuous line (not two lines as it may appear above). Here's an explanation of the parameters I used:

-c
This stands for 'continue', you could use --continue instead of -c, both do the same thing. This will mean that if the download of this file is interrupted, you can issue exactly the same command again later and it'll continue the download where it left off.

--ftp-user=michael
If the FTP site you are accessing requires authentication then you can specify the user name this way. Here I put the user name "michael", this is just an example.

--ftp-password=abc123
This is how to specify the password, the "abc123" is only an example password.

ftp://192.168.0.3/file.zip
Put the FTP address, path and file name. The above is just an example.

The following shows what it would look like for real if you used the above command line (click them for larger images):










The following is a video tutorial by jimmyr.com (not me!) and it's pretty good at showing you the basics:
 


Proxy
Wget has a lot of features to help you download. One I wanted and at first I couldn't find much information on, was downloading from an FTP site when your FTP goes through a proxy. If this is the case, before you run your Wget command line, set the command line (DOS) variable ftp_proxy. For example: 
set ftp_proxy=10.1.1.1:8080

Of course "10.1.1.1:8080" is just an example, you'd need to put whatever your proxy address and port number is here. 


Limit Bandwidth Used
The following is a useful parameter for Wget, especially in low bandwidth scenarios:
--limit-rate=
You can use this to limit the bandwidth used by Wget when downloading. For example:
--limit-rate=6k
The 6k means 6 kilobytes per second, not kilobits per second as you might expect. Kilobits (Kbps) is the usual way of measuring bandwidth. As there are 8 bits to every byte, you can calculate what this is in kilobits by dividing kilobits by 8 to get the number of kilobytes for the limit rate parameter.

Here are some examples:
4k means 32Kbps
6k means 48Kbps
8k means 64Kbps
16k means 128Kbps
32k means 256Kbps
64k means 512Kbps
128k means 1024kbps (1Mbps)

Limiting the bandwidth used doesn't mean Wget will download at that speed exactly, it is the maximum, it won't use any more bandwidth than this limit.


When Wget runs I don't think it hogs all the bandwidth in any case, but this feature really is useful in ensuring it doesn't hog the bandwidth, especially if your internet line has to be used by other services at the same time.


By the way, if you want to check how long it takes for a particular size file to download at a particular speed (kbps), take a look at this website:
http://www.numion.com/calculators/Time.html


Conclusion
Wget is an excellent command line tool. I went on to use it in a number of programs I wrote using AutoIt. Using AutoIt you can create a seamless wrapper for Wget and control what parameters are sent to it depending on the circumstance. Wget has proven reliable, fast and versatile. The above is just one thing it can do, it also supports downloading multiple files and folders, HTTP, HTTPS, as well as FTP. 

Currently Wget doesn't support SFTP, although to do this from the command line, take a look at another great free utility for Windows: WinSCP.

Wget works the same on Windows as it does on Linux. This can be useful if you use Linux at any time, for example, Ubuntu has Wget installed as standard. You can use it with the same command line parameters as described above, it works exactly the same. More interesting features can be found in the manual, a link is listed below.



Links

Wget.exe download:

Wget manual:
Lots more details about Wget:

WinWget - a Windows GUI interface for Wget:

AutoIt Windows scripting:
http://www.autoitscript.com/

WinSCP (SFTP Windows command line)
http://winscp.net/

Download speed / time / file size calculator:
http://www.numion.com/calculators/Time.html

Baca Selengkapnya ....

NetWare Error -631 when installing the NDS

Posted by Unknown Kamis, 03 Desember 2009 0 komentar
This was something I encountered with Novell NetWare 6.0 SP5e, so it's only interesting to a small group, but I thought I'd write about it as when I had the problem I didn't find anything on the web about it. Here goes:

Scenario
Two servers installed with NetWare 6.0 SP5e. Let's call them servers A and B. 
Server A had the master replica (NDS/eDirectory).
Server B had a read/write replica.

I wanted to add a third server into the tree, to put a replica on it. This third server we'll call Server C.

On server C, I entered NWCONFIG, select Install Directory Services onto this server. After entering the tree and IP address of server A (where the Master replica is located) I received the following error:

An internal error has occurred. DSI cannot add a partition replica. Error description: unknown error -631 (fffffd89 hex) - (DSI-5.0032)

What I tried...
I tried all kinds of things, ensuring the time was correct on all the servers, running DSREPAIR (all servers showed zero errors). I checked the http://support.novell.com website and Google, but no, I couldn't find anything applicable to my situation.


My solution
My solution is probably more of a workaround if I'm honest. I didn't get to the bottom of this problem, but I got it to work - here's what I did:
I designated Server B as Master. From Server C I ran NWCONFIG, Install Directory Services onto this computer, I entered the IP address of Server B (now set as Master). 
It worked!!! No -631 error!

In a nutshell, if you have -631, just try installing the NDS/eDirectory from another server.


Why?
I don't know. I ran DSREPAIR and had zero errors so I really don't understand why I couldn't install the NDS replica onto Server C from Server A. After the installation worked, I designated Server A as the Master again, it was and is still working fine. It's a mystery!

Baca Selengkapnya ....

HTC Hero mobile data settings (Swisscom)

Posted by Unknown Sabtu, 28 November 2009 0 komentar
If you switch on Mobile Data but your HTC Hero doesn't connect to the G3, Edge nor GPRS networks, you should check 'Access Point Names' settings. In Switzerland, if you are using an HTC Hero phone with a Swisscom contract, here's what you should do:

Settings | Wireless & Networks | Mobile networks | Access Point Names

Press the Menu button and add a new APN as follows:

Name : Swisscom
APN : event.swisscom.ch
Proxy :
Port :
Username :
Password :
Server :
MMSC : http://mms.natel.ch:8079
MMS proxy : 192.168.210.002
MMS port : 8080
MCC : 228
MNC : 01
APN type :


Reference

Baca Selengkapnya ....

Nucleus Kernel Windows Data Recovery Software

Posted by Unknown 0 komentar
Back in 2006 I had a hard disk crash and I used a program called Nucleus Kernel FAT + NTFS to recover files from the disk. Here's my review of this software:

17/04/06 - If your hard disk drive falls ill and your partitions are corrupted, you can use this utility to recover data files from those corrupted partitions. Just to be clear - there are two different types of data recovery program available on the market today; those that fix/repair corrupted partitions and those that recover data files. This one recovers data files! It does not fix/repair the corrupted partitions. Nucleus Kernel must be installed on a Windows XP computer. Normally you'd have two hard disks in your PC, a good one where Nucleus Kernel is installed and the bad disk. Run Nucleus Kernel and it will read (slowly - it can take many hours to scan a 160GB disk) the bad disk and give you a list of files it can recover. This list can be saved - this is a good idea as the scanning can take a long time. Saving the list of recoverable files means you can skip scanning the next time you use the software. I've used this software myself to recover data from a hard disk that went bad on my home PC. It works!!! I also used it to recover deleted files from a USB hard disk drive. The user interface is very easy to use which is surprising for this kind of software.

Nucleus Kernel is not free, you do have to pay for it. However, firstly you can download a free demo. This allows you to scan for recoverable files, but you can't recover any files. So it's useful just to see if it can help you before you spend your hard earned money. In any case, the cost is reasonable. When you buy the software, if you pay by credit card you can download it immediately.

Find out more here:
http://www.nucleustechnologies.com/FAT-NTFS-Data-Recovery.html

My rating: 8/10, recommended!

Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of apk zippy.