LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   run the program after 15min (https://www.linuxquestions.org/questions/linux-newbie-8/run-the-program-after-15min-631425/)

dina3e 03-29-2008 01:25 AM

run the program after 15min
 
i just want to run the $ps command after each 15min.
to watch the process status of the system..
is there any command to run such type of program in in some sort of interval.

Tinkster 03-29-2008 01:29 AM

With output to where?

You could (if you set aside a terminal for it) use watch for
this ...

watch -n 900 "ps -ef"


Cheers,
Tink

syg00 03-29-2008 02:33 AM

I tend to stick things like this in a loop, and sleep for the required time.

sathiyamoorthy 03-29-2008 03:40 AM

use cron
 
*/15 * * * * ps > /tmp/file_ps.out


use cron.....

It records the output in the file, and you can at any time...

Use ps options ...
Use ps with absolute path...

Is it your requirement ??? or some thing else ???

simplicissimus 03-29-2008 04:02 AM

shell script
 
It is possible to create a shell script to be called by 'cron' in regular intervals creating output in your local web root if you have a web server running. Then you can open the output page in a web browser. When used on a public web server, you can monitor the system from remote locations.

The most simple version of a script for this:

Code:

#!/bin/sh
OUTPUT="/var/www/html/ps.html";
echo "<html><head></head><body><pre>" > $OUTPUT
ps >> $OUTPUT
echo "</pre></body></html>" >> $OUTPUT

Hope this helps,
Regards,
SIMP

Fedora User


All times are GMT -5. The time now is 05:25 AM.