Can a perl script monitor another?

X

xadio

I have been having issues with some of my scripts hanging indefinitely
during operation and it will not do. My plan to fix this issue is to
create a script that will run these "troublesome" scripts and monitor
the elapsed time. If the given time constraint is exceeded then it
will kill the script it is running. Would this be possible?

Thanks,
Xadio
 
S

Sherm Pendley

xadio said:
I have been having issues with some of my scripts hanging indefinitely
during operation and it will not do. My plan to fix this issue is to
create a script that will run these "troublesome" scripts and monitor
the elapsed time. If the given time constraint is exceeded then it
will kill the script it is running. Would this be possible?

Yes.

sherm--
 
J

Joe Smith

xadio said:
I have been having issues with some of my scripts hanging indefinitely
during operation and it will not do.

I usually use a non-perl solution on systems that have 'expect'.

linux% cat /usr/bin/timed-run
#!/usr/bin/expect -f
# run a program for a given amount of time
# i.e. time 20 long_running_program
set timeout [lindex $argv 0]
eval spawn [lrange $argv 1 end]
expect
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top