Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rerun scripts 1

Status
Not open for further replies.

craigdthomas1

Technical User
Aug 18, 2004
4
US
Hello All,

I am very new at this ... so please forgive me if this is redundant. I recently Inherited a few scripts to log(telnet) into our machine and poll data.

My problem is that these scripts only run once and if not initiated within a 15 - 20 minute ... the machine logs out.
(I have seen the schedule, but it only takes 1 hour intervals)

Ideally ... I would like to run the script to log into the machine and poll the data, but once logged in ... I would like to automatically run a command (Dumpdata) every 5 to 10 minutes.

By running this command it would prevent the machine from timing out and keep my screen with fresh data.

I hope this was not too confusing, but any help would be greatly apprecaited

regards,
craig
 
You could use the pause command inside a while loop to give yourself the necessary delay between execution. Here is an example:

proc main
while 1
;place code to run here
pause 300
endwhile
endproc

This will run the code you want every 5 minutes (the pause 300 waits 300 seconds before continuing). If you have a compiled script already to go, you could use the execute command to launch that script, then control would return to the calling script when done. Five minutes later, that script would be called again and so on.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top