Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-29-2008, 01:25 AM   #1
Registered: Mar 2008
Location: Bangalore
Distribution: Enterprise Red Hat linux
Posts: 98

Rep: Reputation: 16
Smile 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.
Old 03-29-2008, 01:29 AM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
With output to where?

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

watch -n 900 "ps -ef"

Old 03-29-2008, 02:33 AM   #3
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,989

Rep: Reputation: 3281Reputation: 3281Reputation: 3281Reputation: 3281Reputation: 3281Reputation: 3281Reputation: 3281Reputation: 3281Reputation: 3281Reputation: 3281Reputation: 3281
I tend to stick things like this in a loop, and sleep for the required time.
Old 03-29-2008, 03:40 AM   #4
Registered: Feb 2008
Posts: 32

Rep: Reputation: 15
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 ???
Old 03-29-2008, 04:02 AM   #5
Registered User
Registered: Mar 2008
Posts: 104

Rep: Reputation: 15
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:

echo "<html><head></head><body><pre>" > $OUTPUT
ps >> $OUTPUT
echo "</pre></body></html>" >> $OUTPUT
Hope this helps,

Fedora User

Last edited by simplicissimus; 04-02-2008 at 05:07 AM.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
nvidia xorg: Black screen after 15min frenchn00b Debian 2 02-09-2008 12:16 AM
Simple C++ Program: Program Compiles But Won't Run (Segmentation Fault) violagirl23 Programming 3 01-09-2008 12:09 AM
How to run a program in an ssh session that will run after you close out the session? dr_zayus69 Linux - Networking 5 03-05-2006 07:15 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 08:19 AM
Network loss after 15min bjwesselink Linux - Networking 4 08-11-2003 10:43 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration