LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-29-2008, 02:25 AM   #1
dina3e
Member
 
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, 02:29 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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
 
Old 03-29-2008, 03:33 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,839

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
I tend to stick things like this in a loop, and sleep for the required time.
 
Old 03-29-2008, 04:40 AM   #4
sathiyamoorthy
Member
 
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, 05:02 AM   #5
simplicissimus
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:

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

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


Reply

Tags
time


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 01:16 AM
Simple C++ Program: Program Compiles But Won't Run (Segmentation Fault) violagirl23 Programming 3 01-09-2008 01: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 08:15 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 09:19 AM
Network loss after 15min bjwesselink Linux - Networking 4 08-11-2003 11:43 AM


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

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