When were all scripts on the Solaris server last executed?


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Quote:
Originally Posted by josamy
I need to migrate the scripts to Linux but I would like to know which ones are currently being executed rather than migrating all 500 of them.
Is there a way in Solaris 5.9 to do this? I have googled and I believe there is a way in the later versions but not sure about this ancient version.
Solaris 9 is old (released in 2002, supported until 2014), but is not ancient. The "ls" command hasn't substantially changed in the last 3 or 4 four decades so identifying the scripts that have been accessed is a first and easy step. Same for accounting which was supported by Solaris 9.

Anyway, a simple method to identify if existing scripts are executed is to wrap them with a logger script.

For example, assuming you have several shell scripts in the /opt/local/bin directory

You create a directory /opt/local/bin_org and move the scripts you want to monitor in it, then you create a wrapper script and have the system using it when the original scripts are expected:

Code:
cd /opt/local/bin/
cat > .wrapper <<%
#!/bin/ksh
echo \$0 "\$@" called at \$(PATH=$(getconf PATH) date +%Y%m%dT%H%M%S) >> /var/tmp/scriptLogs
exec \$(PATH=$(getconf PATH) dirname \$0)/../bin_org/\$(PATH=$(getconf PATH) basename \$0) "\$@"
%
chmod +x .wrapper
for script in ../bin_org/*; do
    ln .wrapper $(basename $script)
done

Execution logs will be in /var/tmp/scriptLogs
These 2 Users Gave Thanks to jlliagre For This Post:
# 9  
Sorry for the delay in responding and thanks for all your responses.


So basically I am in the process of migrating from Solaris 5.9 to Linux.


We are in the build stage and the Linux system is currently run by another vendor who cannot/ will not confirm what scripts are currently running.


There are over 500 shell scripts on the old Solaris server and I have no idea which ones I need to migrate to Linux.


Hence the question about how do I know what is currently being executed.


I am in the process of wading through the crontabs but was looking for a more time effective method of identifying currently used scripts.


Cheers
# 10  
Why not just copy over all the files (scripts) and be done with it for now?

That way you will not have many mistakes.
# 11  
Alternatively, you might just move to a supported Solaris Version (11.4), or to an OpenSolaris now Illumos derivative...
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Multiple shell scripts executed in one script
Madhu Siddula
Hi every one, i am new to shell script. my people given a task to write a shell script that should execute number of shell scripts in that. in that, if any shell script is failed to execute, we have to run the main script again, but the script should start execute from the failed script only.. it...... Shell Programming and Scripting
6
Shell Programming and Scripting
Multiple shell scripts executed in one script
Madhu Siddula
Hi every one, i am new to shell script. my people given a task to write a shell script that should execute number of shell scripts in that. in that, if any shell script is failed to execute, we have to run the main script again, but the script should start execute from the failed script only.. it...... Shell Programming and Scripting
1
Shell Programming and Scripting
Procedure to be executed from shell scripts
sv0081493
Hi, I am looking for a script wherein i will be able to execute below procedures one by one in line and next procedures starts only when the previous one completes and also after execution of each procedure i will be getting a automted mail as "PL/SQL PROCEDURE SUCCESSFULLY EXCETUTED". ...... UNIX for Advanced & Expert Users
1
UNIX for Advanced & Expert Users
Scripts in solaris server
chn10db001
hi, i want to know whether we can use both perl and unix shell in a single script in Solaris server... Solaris
4
Solaris
Staus of Executed Scripts
pathanjalireddy
Hi There, I have 3 scripts that have to be run one after the other. All 3 scripts are dependent of the other. Now, If I am about to run the second script, assuming that the first script has already been run, can I get the status of the first script. The problem is that, My second script has...... Shell Programming and Scripting
11
Shell Programming and Scripting