From owner-freebsd-questions@FreeBSD.ORG  Thu Aug 23 18:59:26 2007
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
Delivered-To: freebsd-questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0F89416A421
	for <freebsd-questions@freebsd.org>;
	Thu, 23 Aug 2007 18:59:26 +0000 (UTC)
	(envelope-from mnslinky@gmail.com)
Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181])
	by mx1.freebsd.org (Postfix) with ESMTP id A526613C48E
	for <freebsd-questions@freebsd.org>;
	Thu, 23 Aug 2007 18:59:25 +0000 (UTC)
	(envelope-from mnslinky@gmail.com)
Received: by py-out-1112.google.com with SMTP id u77so1136464pyb
	for <freebsd-questions@freebsd.org>;
	Thu, 23 Aug 2007 11:59:24 -0700 (PDT)
DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta;
	h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer;
	b=LlbugJwL2xvgdQW9KJ5sXsF4w72G7puXLXe8cv08Z31RYuKAnevKAPxPA9O0tZBVFLT9RPyex5j/JI9xbIS002lqhVRNnL0+FH75PESBpvJ6VC2Pr6N3PCjwlY4jbEAyUVdtlYUwx++DmEwQOQwxxRqCcTvpDolORof8wsEOpvI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta;
	h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer;
	b=aEXqp/cPhBveJZYjYKZYMhZhXky3myNqDDY+UJOtVbA9KGFLpH7WHbdxP9kSqEOa9vxf4Y72rZ2sujwLX7OgB6DUctFK/MtZKfNrzCT1wRU2cKbgZKy5PeZJakjruyWyOee2L6z+44mwAXFgC/tfTitfn7fKqbP+f6uSnZN+tYo=
Received: by 10.35.49.1 with SMTP id b1mr2424392pyk.1187895564326;
	Thu, 23 Aug 2007 11:59:24 -0700 (PDT)
Received: from ?10.0.0.14? ( [74.95.66.25])
	by mx.google.com with ESMTPS id w38sm3316972pyg.2007.08.23.11.59.17
	(version=SSLv3 cipher=OTHER); Thu, 23 Aug 2007 11:59:17 -0700 (PDT)
In-Reply-To: <015401c7e5b6$24b77580$180ca8c0@arm.synisys.com>
References: <015401c7e5b6$24b77580$180ca8c0@arm.synisys.com>
Mime-Version: 1.0 (Apple Message framework v752.3)
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Message-Id: <665F72C1-5495-4BD3-98E4-F687FB7B7BDA@gmail.com>
Content-Transfer-Encoding: 7bit
From: Eric Crist <mnslinky@gmail.com>
Date: Thu, 23 Aug 2007 13:59:09 -0500
To: "Narek Gharibyan" <ngharibyan@arm.synisys.com>
X-Mailer: Apple Mail (2.752.3)
Cc: questions@freebsd.org, freebsd-questions@freebsd.org
Subject: Re: load script at bootup
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Aug 2007 18:59:26 -0000

On Aug 23, 2007, at 1:48 PMAug 23, 2007, Narek Gharibyan wrote:

> #!/bin/sh
>
> Ping -Dc 3600 xxx.xxx.xxx.xxx | tail -4 >>/root/stat && date >> / 
> root/stat
> && echo "===========================" >> /root/stat
>
>
>
> I wrote this script for collecting ping statistic (after I email to  
> a group
> the stat file).
>
> 1. how can I run this at startup

You can use cron with an entry similar to:

@reboot /path/to/script.sh

This will work as long as your script has the execute bit set for the  
user trying to run it.

> 2. how can I restart this script after 3600 counts down

You can use something like sleep, or you can schedule, again using  
cron, the script to run every 3600 seconds.  An entry such as:

0  *   *  *  * /path/to/script.sh

This will re-run your script every hour, on the hour.

> 3. Is there a program, script or any way more appropriate to track the
> packet loss and ping availability.?

I would recommend using some nrpe module you write for nagios and/or  
cacti to monitor and even graph this information.

> Thank you in advance

No problem!

-----
Eric F Crist
Secure Computing Networks