DOS script which will ping once every 60 seconds

Hi,

I would need help to create one ping at the time for every 60 seconds.

Thanks.

REgards,

rAdny
randybanariaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
JT92677Connect With a Mentor Commented:
One ping in 60 seconds is hardly a DNS traffic issue given the enormous number of packets required to render a single webpage.

but if that is a great concern, he could issue a ping to an IP address in the network that does not resolve to any hardware.

This next set of commands pings my FTP server every 60 seconds using a non-existent IP for the 60 second wait interval

:loop
ping -n 1 -w 500 172.16.42.21
ping -n 1 -w 6000 172.16.42.254
goto loop

I can't get too excited about a ping every minute on the public nework, given the enormous volume of traffic required to render a single webpage.

0
 
namolCommented:
Create a batch file with ping -n 1 targethere in it and then add it to the scheduler per the instructions on this page.
http://www.videohelp.com/forum/archive/need-to-run-a-vbsscript-every-60-seconds-t247224.html
0
 
DhopeCommented:
Following should do it (save as a batch file)

:startagain
PING -n 1 machineName >>ping.log
TYPE NUL | CHOICE.COM /N /CY /TY,60 >NUL
goto startagain
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
QlemoDeveloperCommented:
Or the traditional way:

:loop
ping -n 1 machine
ping -n 61 127.0.0.1 >nul 2>nul
goto loop

0
 
randybanariaAuthor Commented:
I will try them.

let you know what's the result..

Thanks.
0
 
randybanariaAuthor Commented:
i should close this ticket becoz it's a redundant ticket.
0
 
JT92677Commented:
This avoids pinging localhost over and over again

:loop
ping -n 1 -w 500 mit.edu
ping -n 1 -w 6000 noplace.tv
goto loop

ping the target 1 time, wait at most 5 seconds for a response
ping a non-existent site 1 time, waiting for 60 seconds (it won't respond)
loop back to beginning

Doesn't keep pinging localhost or using a file for junk output
0
 
QlemoDeveloperCommented:
Pinging localhost is less bad then pinging into internet, or creating unnecessary DNS traffic. If using the "wait timeout" method, you should use a fixed, non-routed address which is not existing. That's causing ARP traffic only.
0
 
QlemoDeveloperCommented:
If it is for any use - ok. But totally senseless traffic should be avoided. And the "one ping per second to localhost" is no burden to the CPU or anything. Why not use it?
0
 
JT92677Commented:
Apparently it is for a use although the direct benefit isn't obvious, the indirect benefit is that it solves the problem with virtually no impact on the network, regardless of how senseless it appears.

But in deference to your observation, I suggested an alternative to ping a local unused IP address on the local network. Or is that a problem too?

The objective is to solve the problem. Check out "suboptimal" and "suboptimization"

http://en.wiktionary.org/wiki/suboptimal
0
 
QlemoDeveloperCommented:
"This avoids pinging localhost over and over again"
This implies that there are cons. There are none.

If you just wrote: "If you don't like pinging localhost every second ...", this would have been an alternative. Your proposal creates the imagination that it is better than all others. It is not.
I myself often present both solutions as coequal alternative ways. Choosing one of them is no matter of logic, but of preference.

In  reference to your reference: I don't know what you want to say with it. Didn't you see the last message  of original poster: "i should close this ticket becoz it's a redundant ticket."? This tells you it is not even suboptimal to further post here.
0
 
JT92677Commented:
QLEMO: Since you seem to want to argue about my posts, let me address your concerns:

Pinging over and over again relies on the idea that each ping response takes a known amount of time, and that there won't be any accumulated error using multiple pings with unpredictable timing. This is simply wrong.

I would submit that a single ping with a 60 second timeout, to a non-existent IP address will run a single timer and produce a more accurate result, and that it is simpler to understand as well.

As is the case in many solutions, the simplest solution is often the best one, as anyone who understands the idea behind Occam's razor. I think my solution is simple and easy to understand, and it produces the expected results.

The author has not closed the ticket, perhaps this is why he used the term "should" instead of "will." Apparently the ticket is still open, or the author has lost interest. My crystal ball is not providing a clear answer to this question, maybe you know what's in the authors mind, I don't.

Your use of "not even suboptimal to further post here" -- is a bit confusing, and seems to indicate a misunderstanding of what is meant by suboptimal.

As to creating the imagination that a solution is better than another, I'll stick with the idea that simpler is better.

Since you have so many points (and have been an EE contributor for many years) you might simply clean up this question on your own. I am a new EE member, but that doesn't mean I'm new to solving computer problems. As a result, I don't have nearly as many points as you do, but you have a 5 year or more head start <<grin>>

As I see EE, we're here to provide suggestions, and alternatives. Points are a byproduct, not the purpose of a comment or solution.
0
All Courses

From novice to tech pro — start learning today.