2

How can I set a timeout for wget and get a notification the connection times out in 20 seconds?

So far I've tried the following command

   wget  --spider www.example.com
5
  • It is not clear what you are asking
    – Bruno9779
    May 27, 2014 at 12:11
  • @Bruno9779 sorry for my english. i want to get any alert if url doesnt response in time limit. May 27, 2014 at 12:16
  • what is the context you are using wget? as part of a script? or raw command line?
    – Bruno9779
    May 27, 2014 at 12:20
  • @Bruno9779 on command line. May 27, 2014 at 12:21
  • 1
    Wow, downvote-fest! Come on guys, if you are going to downvote at least have the decency to explain why so that people can improve their questions and answers. May 27, 2014 at 14:04

1 Answer 1

1
wget -T 20 --spider www.example.com || ping -n 1 www.example.com

However, ICMP/pings aren't always useful for determining site availability since they have been used in distributed denial of service attacks since the beginning of the century.

1
  • thnx to you. i did it! May 27, 2014 at 12:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .