One obvious solution would be to copy your scripts into a subdirectory, called subdir
in the following example, and replace the originals with links to a 'front end' script
comprising something like the following, where app_incr.pl is a script that updates
a table record for a supplied key (the script name $0):
 
   perl app_incr.pl  "$0"
 
   "./subdir/$0"  "$1"  "$2"  "$3"  ....
 
where you include as many "$" variables as the maximum number of arguments
which will be used with any of your scripts.
 
(You need to quote each argument, to ensure that originally quoted arguments
e.g. for values with embedded spaces, remain correct when they get inside
the original scripts.)
 
 
Cheers
 
John Ramsden
 
-----Original Message-----
From: Travis Hoyt [mailto:[EMAIL PROTECTED]
Sent: 06 April 2004 13:52
To: Suresh Babu (RBIN/EDM3) *; [EMAIL PROTECTED]
Subject: Re: [Perl-unix-users] To find number of times each script is used.

Sounds like what you need is an IDS (intrusion detection) agent.  Since they constantly watch file access and modification you could set them to trigger a counter of some type.  If you're wanting to do this with Perl it would be difficult unless you essentially wrote and IDS agent in Perl.  Cron isn't granular enough to achieve the desired results as scripts could be executed multiple times within a single minute so your count would be inaccurate.

"Suresh Babu (RBIN/EDM3) *" <[EMAIL PROTECTED]> wrote:

Hello All

I have a peculiar requirement. I have scripts in some directory. I want to log , how many times each script is executed.I dont want to change existing scripts, i mean dont want to add SIGNAL trapping for all  these scripts as i have many scripts in this directory.  I can keep a crontab and find the access time of each script.But the problem is I want the exact  number of times each script is used.  How to do exception handling for this situation and I want to do it on Unix.


Any help is greatly appreciated.

Thank you

____________________________________________________________

      BOSCH                            Robert Bosch India Limited         
                                               RBIN/EDM3
                                               123, Industrial Layout
      Suresh   Babu                            Hosur Road, Koramangala
                                               Bangalore 560 095

                                   INDIA

                                               Tel.     +91 80 5119 - 4519
      mailto:[EMAIL PROTECTED]           Fax     +91 80 2508 - 1404

____________________________________________________________


_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to