Find last executed timestamp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Find last executed timestamp
# 1  
Old 02-09-2012
Find last executed timestamp

Hi,
on our hp-ux box we have 100s of shell scripts in a bin folder.
Now i have to figure out which scripts are not being used at all.
The timestamp for these are the ones when they were promoted to this 'bin' folder.
Now, how can I find when was the last time each of these scripts were run?
I cannot update the scripts now (to write some log that i can capture to see when it was run) as these are production jobs.

Thanks,
-srinivas yelamanchili
# 2  
Old 02-09-2012
The last time a script was executed is the the time it was read.

If someone has gone not gone in there and done a cat on them or opened them another way, then the above statement is correct.

Code:
ls -lu

gives the last time of access (read)
# 3  
Old 02-09-2012
Network

Thanks Jim,
unfortunately whenever a new script is promoted to this 'bin' folder, permissions are set for all files in the folder (by the utility that does the migration and we cannot change this process) and not just the new scripts.
So when i do the 'ls -lu' it shows the same timestamp for all files
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find Original user who executed the command

Hi Team, Please help me with the below question. SunOS 5.10 Shell: -bash I am trying to find the original user who executed a command on my development server. In my dev server users login using their personal id and sudo to a common id using 'sudo -u commonid -i'. Once logged in as... (6 Replies)
Discussion started by: sam99
6 Replies

2. Shell Programming and Scripting

Find logon user based on executed script proc id

Hi, i have requirement to find logged in user based on process id. i have below scenario. 1. all my users will logon to unix box using ssh from windows system. 2. after successful logon they will sudo to common user. ex. sudo -su edadm lot of users are executing jobs from edadm user and... (2 Replies)
Discussion started by: tmalik79
2 Replies

3. Shell Programming and Scripting

How to append timestamp in the filenames using find?

Hi, How to change the filenames with timestamp in sub folders I have the following code to select the records. find . -type f -name '*pqr*' -ctime 1 -print The following is the example app_root_dir="/`echo $ScriptDir | cut -d'/' -f2`" $app_root_dir/../BadFiles directory uvw.bad... (3 Replies)
Discussion started by: bobbygsk
3 Replies

4. AIX

How to find the log for executed command in IBM AIX?

In Unix If we executed any command where will generate the particluar log related to command in Unix. (4 Replies)
Discussion started by: victory
4 Replies

5. Shell Programming and Scripting

Find logs between two timestamp

Suppose there are log entries like 16 Jul 2012 11:46:45,628 SendToClientService ExecuteThread: '256' for queue: 'weblogic.kernel.Default (self-tuning)': Received an unknown fault. 16 Jul 2012 11:47:45,650 SendToClientService ExecuteThread: '256' for queue: 'weblogic.kernel.Default... (4 Replies)
Discussion started by: snehasish_jana
4 Replies

6. AIX

Script not getting executed via cron but executes when executed manually.

Hi Script not getting executed via cron but executes successfully when executed manually. Please assist cbspsap01(appuser) /app/scripts > cat restart.sh #!/bin/ksh cd /app/bin date >>logfile.out echo "Restart has been started....." >>logfile.out date >>logfile.out initfnsw -y restart... (3 Replies)
Discussion started by: samsungsamsung
3 Replies

7. Shell Programming and Scripting

how to find status of last executed cmd in perl?

In shell we can find the status of last executed command by $? In perl what is the command to find the status of last executed command... Can any one please say??????????????? Thanks, Prabhu (1 Reply)
Discussion started by: prsampath
1 Replies

8. Shell Programming and Scripting

Find a value and the previous timestamp

Hi, I need to do a script that find a specific data in var_5 and also the previous timestamp. This is the file I have: var_1=data1 var_2=data2 var_3=data3 var_4=data4 var_5=data5 var_6=data6 var_7=data7 RESULT PRINTOUTS: 6404 var_1=data8 var_2=data9 var_3=data10 var_4=data11... (7 Replies)
Discussion started by: gcsilva
7 Replies

9. Shell Programming and Scripting

How to find pid of PS which executed by perl system function

hello All, I need to invoke by perl script some program/command and monitor it for 5 minutes . In case it still running for more then 5 min I need to send a signal which will stop it. I implemeted this as shown below by using eval & alarm and I'd like to know if there is a better way to... (1 Reply)
Discussion started by: Alalush
1 Replies

10. UNIX for Dummies Questions & Answers

how to find the exit status for the last executed command

I am executing a find command in my script i.e find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \; how do i check that this command is executed properly.. i would lke t trap the errror and display my error message kinly help.. this is an urgent issue. (1 Reply)
Discussion started by: vijay.amirthraj
1 Replies
Login or Register to Ask a Question