944,015 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 7122
  • Perl RSS
Oct 3rd, 2004
0

Calculate the amount of time in the linux process using perl script

Expand Post »
Hello all!

Can somebody help me write a perl script which totals the total amount of time that each user is using on the system, as well as the number of processes the user is using.

As example:
The output of your program would be the following:

root 00:01:18 13
ananias 00:00:00 1
dias 00:00:00 1
peter 00:00:00 1
Reputation Points: 11
Solved Threads: 0
Newbie Poster
flory is offline Offline
4 posts
since Jul 2004
Oct 3rd, 2004
0

Re: Calculate the amount of time in the linux process using perl script

>Can somebody help me write a perl script which totals the total amount of time that each user is using on the
>system, as well as the number of processes the user is using.
Pipe the result of a call to ps through your script and parse it, saving the items you want and calculating your totals. ps is different for every system, so do a man ps and when you have more information and you've actually made an attempt, come back and we can help more.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: contribute to my program
Next Thread in Perl Forum Timeline: Perl script to check doc_b against doc_a for inconsistence





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC