troubleshooting Question

Shell script to do time difference, and output based on some logic?

Avatar of mirde
mirdeFlag for Canada asked on
PerlMicrosoft SharePointShell Scripting
7 Comments1 Solution705 ViewsLast Modified:

I am trying to have a script that will output either 1 or 0 based on the following:

Compare a running process time-stamp with current time (at the time of script execution) and figure out the time difference in say.. seconds.. or minutes.. then if the difference is greater than 1 hour, output a 1 to a log file, or 0 otherwise.

Here is an example, I have an AIX utility that monitors some of our processes, the output is below:

PID   State     Port  nRq    nRcvd  nSent  Started          Last Change
1405182 AVAILABLE 15621 004720 005120 005729 Oct 4, 2010 10:17 Oct 4, 2010 12:43
1524142 AVAILABLE 15622 004694 005084 005603 Oct 4, 2010 10:17 Oct 4, 2010 12:43
217226 AVAILABLE 15614 004403 004773 005455 Oct 4, 2010 10:32 Oct 4, 2010 12:43
2519216 AVAILABLE 15606 002399 002590 002943 Oct 4, 2010 11:28 Oct 4, 2010 12:43

If you look at the last column, I wanna be able to take the output "Oct 4, 2010 12:43" and compare it to the current time.

Is this anyway possible?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros