Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Nov 2000 15:50:10 -0000 
From:      Daniel Bye <Daniel.Bye@uk.uu.net>
To:        'Peter' <peterk@americanisp.net>, freebsd-questions@freebsd.org
Subject:   RE: Crontabs
Message-ID:  <FB7CAC781DB6D311BEE800805FE6FADA2F4D74@camexch4.cam.uk.internal>

next in thread | raw e-mail | index | archive | help
The easiest thing to do is to use the -c flag to ping.  This allows you
to specify how many packets to send, then exits when done:

[ecam082: danielby: ~]$ ping -c 5 www.uk.freebsd.org
PING web008.pavilion.net (212.74.4.8): 56 data bytes
64 bytes from 212.74.4.8: icmp_seq=0 ttl=244 time=34.627 ms
64 bytes from 212.74.4.8: icmp_seq=1 ttl=244 time=20.867 ms
64 bytes from 212.74.4.8: icmp_seq=2 ttl=244 time=31.106 ms
64 bytes from 212.74.4.8: icmp_seq=3 ttl=244 time=22.631 ms
64 bytes from 212.74.4.8: icmp_seq=4 ttl=244 time=28.850 ms

--- web008.pavilion.net ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 20.867/27.616/34.627/5.162 ms



You can alter your crontab to log to a file, or better, write a wrapper
script that does all of it - pinging the chosen host the chosen number 
of times, and output that to a file.  Then you can call the script 
from your crontab.

Dan

-----Original Message-----
From: Peter [mailto:peterk@americanisp.net]
Sent: 09 November 2000 15:43
To: freebsd-questions@freebsd.org
Subject: Crontabs


I've not been able to find this in the crontab man pages (I skimmed could
have missed it) but let's say I make a cron job of "ping yahoo.com," and
since ping does not quit until you hit ctrl+c, will the cron job continue
to run until I specifically kill it? If so under ps will it show as user
bob pinging yahoo? or where will I find this under ps?  Does cron kill
it's jobs after x mins? Can I configure it so it will?  (so I don't DoS
myself thru runaways cronjobs).  Another question:  my sendmail crashes
(signal 11, I need to remake it, I suppose) so cron can't send output to
user, does this file/ouput get stored anywhere else?  TY.


*** Fortune ***
Albert Einstein, when asked to describe radio, replied: "You see, wire
telegraph is a kind of a very, very long cat.  You pull his tail in New
York and his head is meowing in Los Angeles.  Do you understand this?
And radio operates exactly the same way: you send signals here, they
receive them there.  The only difference is that there is no cat."


--- www.nul.cjb.net --- The Power to Crash!
--- www.FreeBSD.org --- The Power to Serve!



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FB7CAC781DB6D311BEE800805FE6FADA2F4D74>