Re: How to get closing times of applications using shell



vinod wrote:
Janis Papanagnou wrote:

I guess there might be more appropriate solutions if we knew about
the "Why" of this request.
i want to monitor a user with the above 5 apps for example. and i would
like to know how long each app is being used and when.. ie if a user
launches a browser(or any app for that matter) at 5 different times
during a session, i would like to note down the duration of each
session of the browser(or app). for this.. i need to know the starting
and closing times.

You write that you want to monitor _a_ user, so I assume that you
don't need to change the complete system environment for all users.
Elsethread you write about the user's consent and cooperation, so
there's also no need to use a restricted shell (a shell running in
restricted mode, e.g. rksh).

although initially i would like to monitor for 5 apps, i would like to
do this for all major applications on a user's system. so i guess for a
newbie like me, the solution provided by you would be difficult to
handle if the number of apps to be monitored increases.

Please provide some numbers; how many applications do you expect?

If the number is high - but, frankly, it's hard to believe that you
want to monitor more than 20 applications - you can also generate the
wrapper scripts. If so you must either have a list of files that you
want to consider or a list of directories with binaries (which will
result to a *very* large amount of binaries), and write a generator
script.

i appreciate ur concern. would be looking forward to more solutions
from you.

Why more solutions?

Create directories (if not already present) ~user/bin to contain the
wrapper programs and ~user/tmp to accumulate the logfiles (for privacy
reasons not in /tmp), and adjust access permissions.

Open the users profile ~user/.profile and find the line where PATH
is defined; add ~user/bin to the PATH as in

PATH=$HOME/bin:$PATH

Or tell us if you need help on a generator script, otherwise built the
few wrapper scripts manually, as already outlined upthread.

Janis


thanks a ton,
vinod

.



Relevant Pages

  • Re: WScript.Shell.Exec().StdOut.AtEndOfStream waits for text - solution
    ... Execute the monitor. ... Read output from the app. ... Read output from the monitor. ... If the process terminates, the monitor ...
    (microsoft.public.scripting.jscript)
  • Re: Desktop heap monitoring
    ... I have an application that will let you set watch limits on usage: ... The app was developed for me to monitor a memory leak I had in an ActiveX ...
    (microsoft.public.vb.winapi)
  • Re: Serial port monitoring
    ... app, then you can do this yourself by handling the result from ReadFile. ... there are several commercial ones available (try google for serial port monitor), ...
    (microsoft.public.vc.mfc)
  • Re: Help needed: TCP Server questions/problems
    ... Have a look at remoting for the monitoring of you app. ... have permissions on the file system. ... I know very little about writing server applications. ... I would like to be able to monitor what it is doing. ...
    (microsoft.public.dotnet.languages.vb)