0

Hi all,

I am very new to Unix. Please help me to write a script.
Here is the discription of what the script should do:

The script won't need to be horribly complex; it's to check to see if the hawkagents(a process) on a server have been restarted since the last update to the Hawk rule files or the user variables file, and to generate an error message if they have not been.

-Please help me in finding last update time of a file.
-And last restarted time of a process.
-And how to capmare the date-time of above to times.

Thanks in advance.

2
Contributors
6
Replies
7
Views
8 Years
Discussion Span
Last Post by Luckychap
0

Any particular "brand" of "unix"?
An awful lot of things claim to be "unix", even many things which only look like "unix".

0

Its Hp-Unix.

I think that is what you are asking.
And one thing the 'stat' command is not working on this unix box. Please help me.

Thanks for the response.

0

>date %s

is also not working in HP-UNIX.


Any response is highly appriciated.

Thanks.

0

same thing- it was written mistakly.

date "+%s"

is not working.

Any response is highly appriciated.

Thanks.

0

what I suggest:

I convert the date/time in secs using following command:

perl -e 'use Time::Local; my $time = timelocal(SS,MM,HH,DD,MM,YYYY); printf $time'

and then compare it.


Parsing last update time for any file is done by me using 'awk' and 'cut' command.

But I need to know a way find the start time of a process so that I can parse the date as I had done with the file.

In Sort I want a command to know that gives me startup time of a process so that I can parse it and can use it with perl command show above.

Thanks.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.