a timeout session?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

a timeout session?

Post by Mark Gevry » Mon Jan 10, 2005 4:18 am

Hi. Is there a way to program some thing like...if the script is not doing anything (if it gets stuck) it will restart ot something?Liek if theres no movement for 30 seconds, restart?

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Tue Jan 11, 2005 1:43 pm

Depending on what you're doing, you can code that type of logic in to your script.

Some commands have a built-in timeout value (dderequest, ftp, ask, input, etc). In some situations, a loop could check for time passed too.

User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

Post by tony_smith » Thu Jan 13, 2005 9:29 pm

You might want to look at PS-Tools... I believe it is freeware. PsList dumps out all the processes running on the box . You can dump these into a file and read the file from a compiled script that runs every few minutes through Windows scheduled tasks. The script can look for a task name and check for the amount of time the task has been running. If the task has been running too long, kill it with PsKill.

I use PsList and a complied Msched script to check if a specific application is running. If not, the script sends an email to my cell phone and gets me out of bed... come to think of it... that is not too smart of me... however beats having a pile of voice mail and a mess when I get to my desk.

I have not yet used PsKill, but when I get to it, I will use it to terminate a nasty FTP routine that sometimes chokes and holds up a server.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Jan 13, 2005 11:14 pm

There's a similar thread here http://www.mjtnet.com/usergroup/viewtop ... ght=pskill that led me to pskill, it works great :D

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts