Free web development scripts for the webmasterDevelopment Scripts

 Site Navigation
 o Development Scripts
 o Text Only Edition
 o PHP.net News
 o Tutorials
 o Register an account
 o New entries this week
 o Affiliates/Links
 o Contact Us
 o About us
 o Advanced Search

 Browse Path
 o 3 users online
 o Most users online: 67
 o Home
  o Shell
   o Miscellaneous
    o Script

 Member Login
User Name
Password

 Standards
Valid XHTML 1.0!
Valid 
CSS!

 Recommended Links
 o PHP Freaks
 o Designer Baby Clothes
 o Advertise Here Make Money
 o Wedding Vendor Directory
 o designplace
 o devnet
 o Open Source Design
 o OxyScripts
 o Free Wedding Websites

Find processes over time limit (Rated 0)

Description:

Find non root processes with more than TLIMIT minutes of CPU time.

Code starts here


#!/bin/sh
# Find non root processes with more than TLIMIT minutes of CPU time.
# For machine Sun Solaris 2.6

# MINUTES equals the first parameter or 5 if no parameter.
MINUTES=$1
MINUTES=${MINUTES:=5}

AWK=/usr/bin/nawk

ps -ef |
$AWK 'BEGIN {TLIMIT='$MINUTES'}
$7 ~ ":" { split ($7,t,":");
if (t[1] >= TLIMIT) {print $0 }}
$8 ~ ":" { split ($8,t,":");
if (t[1] >= TLIMIT) {print $0}}' |
grep -v root | sort


Submitted by Devscripts on 26-02-2003 17:04


Rate This Script

User Contributed Comments

Registered Members login
© Copyright 2003 - Devscripts.net