Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jan 2001 10:58:57 -0600 (CST)
From:      Lu!s Croker <lcroker@unix.megared.net.mx>
To:        Francisco Reyes <fran@reyes.somos.net>
Cc:        Jahanur R Subedar <jahanur@jjsoft.com>, freebsd-questions@FreeBSD.ORG, freebsd-isp@FreeBSD.ORG
Subject:   Re: How to find the time....
Message-ID:  <Pine.BSF.4.21.0101081054370.16587-100000@unix.megared.net.mx>
In-Reply-To: <Pine.BSF.4.21.0101081155500.834-100000@zoraida.reyes.somos.net>

next in thread | previous in thread | raw e-mail | index | archive | help

   You can put set the command in a script.... for example...

   #!/bin/sh

   echo "X command Logs" >/var/log/xcommand.log
   date >>/var/log/xcommand.log  #Log the date and time in a file
   time >>/var/log/xcommand.log
   
   xcommand

   date >>/var/log/xcommand.log  #Log again the time and date, when the
   time >>/var/log/xcommand.log  #command finish

   If you log the initial time and the final time, you can know the time
that the command was in execution... 

    Greetings... 
 

On Mon, 8 Jan 2001, Francisco Reyes wrote:

> On Sun, 31 Dec 2000, Jahanur R Subedar wrote:
> 
> > I am trying to find the time of when a particular command was executed.
> 
> What command? Unless the program has some type of loging I don't believe
> there are logs to indicate when apps are run.
> Will you continue to need this?
> A possible solution, unless someone suggests something better, would be to
> run a cron job which does ps and sends the output to a log.
> 
> You could use newsyslog to keep it under control (i.e. don't let it get
> too big).
> 
> 
> 
> 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-isp" in the body of the message




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