- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Scripting help!
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 07:07 AM
10-02-2003 07:07 AM
Scripting help!
We currently have a script (scripta) that runs from 6am till midnight and never terminates within that time... Once it is run, it constantly outputs data to a log file to monitor transactions...
The problem is this script will periodically hang and then the transacations are not viewable via a custom app.
So I have written a script (scriptb) that monitors the date stamp on the log file and compares it to the actual time every 30 minutes. If the time difference is more than 30 minutes, my script (scriptb) runs the restart command for (scripta) And continues monitoring...
The problem is since scripta never terminates, my script just sits there... Of course, waiting to continue when scripta finishes...
Hope this doesn't sound too complicating... Here is the output of my script when it resets and when there is not problem if it helps...
DATE STAMP USER_QUERY
06:00 06:00
06:31 06:00
07:01 06:00
Wed Oct 1 07:01:09 CDT 2003
User Query log file is more than a half an hour old!
Time = 0701, User_Query = 0600
Time Difference = 101
Starting the kill_user_query script
Done!
Starting the start_user_query script
Here is the script results when there are no problems:
DATE STAMP USER_QUERY
06:00 06:00
06:31 06:00
07:01 06:00
07:31 07:31
08:00 08:00
08:31 08:31
09:00 09:00
09:31 09:31
10:00 10:00
10:31 10:31
11:00 11:00
11:31 11:31
12:00 12:00
12:31 12:31
13:00 13:00
13:31 13:31
14:00 14:00
14:31 14:31
15:00 15:00
15:31 15:31
16:00 16:00
16:31 16:31
17:00 17:00
17:31 17:31
18:00 18:00
18:31 18:31
19:00 19:00
19:31 19:31
20:00 20:00
21:31 21:31
22:00 22:00
22:31 22:31
23:00 23:00
23:31 23:31
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 07:10 AM
10-02-2003 07:10 AM
Re: Scripting help!
"scriptb" could then do a "ps -p `cat
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 07:10 AM
10-02-2003 07:10 AM
Re: Scripting help!
--Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 07:30 AM
10-02-2003 07:30 AM
Re: Scripting help!
The final outcome was lets watch it and when it hangs, restart it...
And that is where I am at...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 07:33 AM
10-02-2003 07:33 AM
Re: Scripting help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 08:11 AM
10-02-2003 08:11 AM
Re: Scripting help!
PS_ID=`ps -ef | grep <scripta>`
.
.
.
MYTEST=`ps -p $PS_ID`
if [ "$MYTEST" = "" ]
then
exit
fi
.
.
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 08:12 AM
10-02-2003 08:12 AM
Re: Scripting help!
PS_ID=`ps -ef | grep <scripta> | awk '{print $1}'`
and then the rest from above.
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 08:15 AM
10-02-2003 08:15 AM
Re: Scripting help!
Its late in the day here.....And I'm losing it.
PS_ID=`ps -ef | grep <scripta> | awk '{print $2}'`
.
.
.
MYTEST=`ps -p $PS_ID`
if [ "$MYTEST" = "" ]
then
exit
fi
.
.
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 08:28 AM
10-02-2003 08:28 AM
Re: Scripting help!
When the PID is null, then kick off the other script...
When scripta hangs, the PID is still valid and needs to be killed and the script is restarted...
The problem is when I restart the script (basically with a never ending loop), I can't continue my monitoring phase...
once it kicks off... Because it is waiting for a never ending loop type process to end before it continues...
I don't know if that clears things up or makes it more confusing...