On Sun, Feb 8, 2009 at 5:45 PM, Kulkarni Shantanu <
li...@shantanukulkarni.org> wrote:

> * Abhishek Nagar <nagar....@gmail.com> [090208 17:27]:
> > i need to store the output of "top" in a file five times a day, so i
> > planned to put it in cronjobs but it doesnot work what could be the
> problem
>
> do you have problem with top or with cron? If with top, you might want
> to try,
> # top -b -n1
>
> for cron, you can say like this in crontab,
>
> 00 09,11,13,15,17 * * * /usr/bin/top -b -n1 >> /tmp/top.log
>
>
> substitute the hour field with your required value.
>
>
Shantanu has already given an example. Adding a little explanation to it -
when running a command from cron, the available $PATH variable may not
include the usual list of directories which contain commands(binaries), so,
it is safe and recommended to give the full path to whatever binaries you
use in the cronjob.

HTH...

Best regards,
Pranav
--
______________________________________________________________________
Pune GNU/Linux Users Group Mailing List:      (plug-mail@plug.org.in)
List Information:  http://plug.org.in/cgi-bin/mailman/listinfo/plug-mail
Send 'help' to plug-mail-requ...@plug.org.in for mailing instructions.

Reply via email to