Check programs used most


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Check programs used most
# 1  
Old 07-08-2010
Check programs used most

How can you check the programs that you use most often?
# 2  
Old 07-08-2010
I don't know of any UNIX OS that keeps, by default, track of that statistic. Might be different if there are any auditing tools active (eg. AppArmor or SELinux), and the Window Managers might keep statistics of what they started, but that's very specific.
# 3  
Old 07-08-2010
you can write a specific script that you want to track which program ran and what is the in time..

for exa
Code:
/etc/init.d/cron.d

you can add an extra line to start function end

Code:
......
...........
case "$1" in
  start)
        start
if [ $? = 0 ] ; then
printf "%s\n" "in $(/bin/date) $prog daemon starting" >> /usr/local/bin/daemontracks1
else
printf "%s\n" "in $(/bin/date) $prog daemon tried to start but fail attempt" >> /usr/local/bin/daemontracks1
fi
;;
  stop)
............
....................

# 4  
Old 07-08-2010
There is a standard unix package called "System Accounting". See "man 1m acct". It includes Process Accounting. It is a significant chore to set up and on a busy system creates very large data files ... but it can be worth the effort expecially if you buy a 3rd party presentation package.
# 5  
Old 07-09-2010
Quote:
Originally Posted by ygemici
you can write a specific script that you want to track which program ran and what is the in time..

for exa
Code:
/etc/init.d/cron.d

you can add an extra line to start function end

Code:
......
...........
case "$1" in
  start)
        start
if [ $? = 0 ] ; then
printf "%s\n" "in $(/bin/date) $prog daemon starting" >> /usr/local/bin/daemontracks1
else
printf "%s\n" "in $(/bin/date) $prog daemon tried to start but fail attempt" >> /usr/local/bin/daemontracks1
fi
;;
  stop)
............
....................

Would I also wanna put this in crontab?

Quote:
Originally Posted by methyl
There is a standard unix package called "System Accounting". See "man 1m acct". It includes Process Accounting. It is a significant chore to set up and on a busy system creates very large data files ... but it can be worth the effort expecially if you buy a 3rd party presentation package.
Is this compatible with ubuntu? I didn't see it in the repository.
# 6  
Old 07-09-2010
Question

No for use crontab maybe different method..This code is appended in service scripts..
for Crontab usage you may another script for exa
this script must run every one minute and check the
like this
Code:
 
pid=`cat /var/run/somedaemon
lasptpid=$pid ; 
count=0
if [ `ps -p $pid -o comm=` ] ; then 
echo "active and still running"; else echo "daemon is not running" 
if [ $lastpid != $pid ] ; then "echo new daemon start" ; let count=$count+1 ;else echo "process still running" ; fi; fi
a=$count+$a
echo `ps -p $pid -o comm=` daemon $a times started

# 7  
Old 07-09-2010
If you are not running unix it can be confusing posting questions in a unix forum. No idea whether Ubuntu Linux has unix System Accounting but I doubt it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Difference between inbuilt suid programs and user defined root suid programs under bash shell?

Hey guys, Suppose i run passwd via bash shell. It is a suid program, which temporarily runs as root(owner) and modifies the user entries. However, when i write a C file and give 4755 permission and root ownership to the 'a.out' file , it doesn't run as root in bash shell. I verified this by... (2 Replies)
Discussion started by: syncmaster
2 Replies

2. Programming

Makefiles for different programs

I have several programs in several directories and want to use make to build the executables. What I have done is to put the main programs in their own directory together with a makefile to build the program. Then I am thinking of having another makefile residing in the directory above so I can run... (1 Reply)
Discussion started by: kristinu
1 Replies

3. Shell Programming and Scripting

Installation of programs

I have installed a program and put the stuff on /usr/local/ However when I run a script it gives an error GMT Fatal Error: /home/chrisd/Dimech/GMT4.5.2/share/PS_font_info.d: No such file or directory (1 Reply)
Discussion started by: kristinu
1 Replies

4. UNIX for Advanced & Expert Users

check user installed programs

How do check the programs that the actual user of the computer installed. I do not care at all about the default programs that came with your distro of Linux, I only want the user installed programs. (1 Reply)
Discussion started by: cokedude
1 Replies

5. UNIX for Dummies Questions & Answers

Are programs like sys_open( ) ,sys_read( ) et al examples of system level programs ?

Are the programs written on schedulers ,thread library , process management, memory management, et al called systems programs ? How are they different from the programs that implement functions like open() , printf() , scanf() , read() .. they have a prefix sys_open, sys_close, sys_read etc , right... (1 Reply)
Discussion started by: vishwamitra
1 Replies

6. Solaris

Compiling programs

Hi guys i have posted a thread months ago and a guy called dukenuke or smething like that told me that i have to install Sun Studio if i want to be able to compile programs. I have installed Sun Studio 12 and put it in my PATH but no success compiling anything. when i download some source (tar.gz)... (2 Replies)
Discussion started by: saveka
2 Replies

7. Shell Programming and Scripting

shell programs

how to write pipe for finding out the login names and login time of the users whose login name begins with p. (1 Reply)
Discussion started by: rameshparsa
1 Replies

8. Linux

Linux-programs

I have installed Red Hat Linux 9.0 recently on my computer. Im wondering if there are any good sites for downloading linux programs besides the site of Red Hat. Thank you in advance!:D (4 Replies)
Discussion started by: SolidSnake
4 Replies

9. Programming

TSR programs

hi I want to write a tsr routine which use to replace the screen saver program, is it possible in unix? how to write a tsr in UNIX? what is address of screen saver program so that i can replace my routine in that address. (6 Replies)
Discussion started by: rajashekaran
6 Replies

10. UNIX for Dummies Questions & Answers

Where did my programs go?

I notice that (Mandrake) Linux and Windows do not seem to operate alike in terms of installing third party software. Windows, on one hand, creates icons and adds items to the Start Menu, with the help of the InstallShield--or equivalent, of course, but Linux, on the other hand, seems to care... (3 Replies)
Discussion started by: helvetica
3 Replies
Login or Register to Ask a Question