WGET command retrying to get response


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting WGET command retrying to get response
# 1  
Old 03-27-2012
WGET command retrying to get response

Hi ,

Iam using " WGET " command to hit the URL,i.e. servlet url.

I can trigger the servlet using wget but when servlet is not responding this command retries automatically until it get the positive response from the server.
So this script is running for more than 8 hrs to get the positive response.

My expectation :

This wget should hit the url only once and if it doesnt get positive response from the server with in next half an hour , it should through the mail that servlet is failed.

How to restrict the timings and number of time it should retry hitting the url.

Please advice me,thanks in advance!
# 2  
Old 03-27-2012
From man wget:

Code:
       -t number
       --tries=number
           Set number of retries to number.  Specify 0 or inf for infinite
           retrying.  The default is to retry 20 times, with the exception of
           fatal errors like "connection refused" or "not found" (404), which
           are not retried.

You'll probably also be interested in
Code:
       -T seconds
       --timeout=seconds
           Set the network timeout to seconds seconds.  This is equivalent to
           specifying --dns-timeout, --connect-timeout, and --read-timeout,
           all at the same time.

           When interacting with the network, Wget can check for timeout and
           abort the operation if it takes too long.  This prevents anomalies
           like hanging reads and infinite connects.  The only timeout enabled
           by default is a 900-second read timeout.  Setting a timeout to 0
           disables it altogether.  Unless you know what you are doing, it is
           best not to change the default timeout settings.

           All timeout-related options accept decimal values, as well as sub-
           second values.  For example, 0.1 seconds is a legal (though unwise)
           choice of timeout.  Subsecond timeouts are useful for checking
           server response times or for testing network latency.

This User Gave Thanks to Corona688 For This Post:
# 3  
Old 03-29-2012
Hi Corona688,

Thanks for your help on Wget.

my expectation :

1) If 1st try is failed and iam retrying again before 2nd retry i have to check for "xxxxxxx" entry in the log file.
2) If "XXXXXXX" entry is not available ,i have to allow 2nd retry.
3) If "XXXXXXX" entry is available,i shouldnot allow to retry again.

Can we check the condition between every retry,if yes please advice me how to achieve this..

thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Vi / vim - Insert a external command response

I would like to execute and external command and insert it into a particular area of the file I am editing. Note that I have the ORIGINAL AT&T vi training doc dated 1987. Doesnt explain it. As an example, in a vi editor I have I would like the result : After executing the following... (1 Reply)
Discussion started by: popeye
1 Replies

2. Shell Programming and Scripting

Wget command help

hi, i need help for downloading excel file from internet and convert it to text file wget http://spreadsheetpage.com/downloads/xl/wordfrequency.xls (4 Replies)
Discussion started by: raghur77
4 Replies

3. Solaris

Retrying Host Configuration

I'm trying to run from a generic Sun-OS and am getting the title message repeated indefinitely. I just want to get into the file system to disable some errors I made earlier. Any help? (2 Replies)
Discussion started by: PeterGuerilla
2 Replies

4. Shell Programming and Scripting

How to skip command if it is hanging while waiting for response

Hello, I have a script that contains the command "whois 1.2.3.4" Sometimes this command takes far too long to produce any output and as a result the rest of the script is not executed. Can anyone suggest a method so that if no output is produced after say 2 seconds the script skips that... (2 Replies)
Discussion started by: colinireland
2 Replies

5. Shell Programming and Scripting

Capture http response code from wget

Hi All, I am using wget to call a url..i am getting 202 if it is successful. if not i am forcing the response code to 417. how can i capture the response code and print 0 if it is 202 and 1 if it is not 202 any ideas, please share Thanks, Jack. (2 Replies)
Discussion started by: jack3698
2 Replies

6. Shell Programming and Scripting

Retrying a remote connection after failure

Hi all, I am new to this forum and want an urgent help from you experts. I am currently using SunOs 5.10. I have a .cfi file which contains some commands to be executed in a node(MSC node in telecom) To connect to a node (for eg node name is MSC1) we have a shell script that has the... (5 Replies)
Discussion started by: interceptor16
5 Replies

7. Shell Programming and Scripting

scp command and no response

I should trasfer some files by xxx.xxx.xxx.xxx to local host. In order to check the function works i tried to transfer a single file and I typed: scp -P 21 username@xxx.xxx.xxx.xxx:/filename.nas /filename.nas At this point i haven't response anch i have to type CTRL+C to return to... (2 Replies)
Discussion started by: andreac81
2 Replies

8. Shell Programming and Scripting

Setting array equal to command response

normally when i type: condor_q | tail -1 command line returns: 0 jobs; 0 idle, 0 running, 0 held I want use the number in front of 'running' in a series of equality tests to submit more jobs when my queue gets low. Someone showed me how to do it a few days ago by setting an array equal to... (4 Replies)
Discussion started by: pattywac
4 Replies

9. UNIX for Dummies Questions & Answers

'less' command response is garbled

Helo , I m using RHEL 4. If I run 'ls -laF | more', response is properly display. but when I run If I run 'ls -laF | less', the response is garbled what to do to remove this? Regards, Amit (4 Replies)
Discussion started by: amitpansuria
4 Replies

10. Shell Programming and Scripting

Response Code using wget in shell

I am trying to get the status code of a web request,size of the download file and response time using wget. When i use the command: wget <sitename> ,it gives all these parameters in the command line.But i want to get these values seperately and assign in different variables using shell script.Is... (2 Replies)
Discussion started by: rajbal
2 Replies
Login or Register to Ask a Question