from the wget manpage:
-O file
       --output-document=file
           The documents will not be written to the appropriate files, but
all
           will be concatenated together and written to file.  If - is used
as
           file, documents will be printed to standard output, disabling
link
           conversion.  (Use ./- to print to a file literally named -.)

           Use of -O is not intended to mean simply "use the name file
instead
           of the one in the URL;" rather, it is analogous to shell
redirect-
           ion: wget -O file http://foo is intended to work like wget -O -
           http://foo > file; file will be truncated immediately, and
all....
And, of course, you could start the script with "cd /tmp" and change those
"/root" and "/root/bin" directories to match. Any reason this must be a root
job?

On Fri, Aug 7, 2009 at 11:45 AM, steve <[email protected]> wrote:

>
> I have written a little program that checks some computer ip's that
> have some internal web pages on them. It works fine, (so I dont really
> want to re do the whole thing at this point) Normally the program
> works fine w/out any problems.
>
> However as one always does, you always want to tweak it a bit.
> Normally the program runs from a cron job. Great. But sometimes I run
> it manually by just typing the command in the command prompt. The
> problem is that if im not in the right directory it doesnt work
> properly. This is due to the fact that wget when it is run, creates an
> index.html file which I use to see if it exists to see if the web
> server is running. If the index file is in another directory I cant
> test to see if it is there and it will always fail.
>
> Right now I use ....
> # run wget
> wget --tries=5 --dont-remove-listing 10.1.0.36:12000
>
> #Then check for file in location
>
> if ! [ -e /root/index.html -o -e /root/bin/index.html ];  then
>
> ... Run command to email me if the it fails to find the index file.
>
>
> Basically it works fine. Its just if I run it outside of the directory
> (the script is run from my local bin which is in my path) that the if
> looks in that it fails.
>
> Im no script genius. Its simple and functional.
>
> Is there options that anyone knows of with wget that can staticly tell
> it where to put the index file.
>
> Thanks.
> >
>


-- 

          Daniel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---

Reply via email to