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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture once a day 1

Status
Not open for further replies.

anniezane

Technical User
Sep 17, 2004
1
US
I have Procomm booting up with capture on and have been trying to write a script to cut the capture off at midnight and then back on moments later. I found the script listed below and complied it OK but when I try checking it by changing the date it does not work.

PROC MAIN

when $date call PROC newdate
endproc

PROC newdate
capture off
capture on

endproc

Can anyone help?
 
The problem is that the script will run and then quickly end. You need to add a loop of some sort after the when command so that the script keeps executing. Probably the best for your task would be:

while 1
yield
endwhile


aspect@aspectscripting.com
 
I solved this issue by modifying the stock Datecap.was file by removing all interacion and adding the following to the bottom of it. The script shuts down every night @ 23:59:55 Procomm then closes.Then I use Windows task manager to start it back up at 00:01:00 and launch the modified Datecap.wax script which opens a new capture file with todays date as the name. The script is fairly long but I will share it with anyone who would like the whole thing. The script has been running everyday for 14 months without a problem.
As a side note I also put the same task in the task manager to launch on reboot. This has also worked without a flaw.

proc ReStart
capture on
timestr = "23:59:55" ;Time to wait for
waituntil TimeStr
capture off
pause 1
endproc

proc Shutdown
pwexit
endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top