"Mordechai T. Abzug" wrote:
> 
> Sometimes, I run wget in background to download a file that will take
> hours or days to complete.  It would be handy to have an option for
> wget to send me mail when it's done, so I can fire and forget.
> 
> Thanks!
> 
> - Morty

wget comes from the *nix world where utilities tries to be good at one
or two things and relay on other utilities to good at other things so
that they don't bloat their code. E.g. wget is good at downloading files
from the internet: using http and ftp adding other protocol might be a
natural thing for wget to do. But for sending mail there're already a
lot of other utilities that's good at that.

And there are also a bunch of utilities that are good at making other
utilities cooperate and intercomunicate: those are the shells.

I use the bash shell so if I wanted this feature I'll type something
like:

$ (wget -r -l 0 http://www.vigilante.com/ | mail -s "wget run completed"
`id -un`) &

Arghhh, wget sends the output to STDERR. Well then sm like:
$ (wget -r -l 0 http://www.vigilante.com/ 2>&1 | mail -s "wget run
completed" `id -un`) &

Or if I used it a lot make a litlle script for it:
$ cat>~/bin/bwget
#!/bin/bash
# Background wget: runs wget and sends a mail when finished
(wget $* 2>&1 | mail -s "wget run completed" `id -un`) &
^D
$ chmod 0700 ~/bin/bwget

Look at the documentation for the shell you use.


-- 
Med venlig hilsen / Kind regards

Hack Kampbjørn               [EMAIL PROTECTED]
HackLine                     +45 2031 7799

Reply via email to