The following script (which I was able to put together thanks to this forum) saves the capture data to a file and names the file after the current date and time. I would like to have the script automatically stop and start each day (ie: 8:00am) so it will start a new capture file daily. Any ideas on the best way to do this? Thanks.
proc main
string DateString, TimeString, sCap
string CapName ; Name of capture file to open.
; Grab current time and date and place them into those string variables
ltimestrs $LTIME DateString TimeString
; I found out that Procomm does not like slashes or colons in capture filenames
; so lets replace all of these offending delimiters with hyphens
strreplace DateString "/" "-" ;Replace all slashes in date string with hyphens
strreplace TimeString ":" "-" ;Replace all colons in time string with hyphens
; Now concatenate the capture filename together
strcat CapName "Procomm_Capture_"
strcat CapName DateString
strcat CapName "_"
strcat CapName TimeString
strcat CapName ".cap"
set capture overwrite on ; overwrite old capture file data with new data
set capture query off ; do not prompt user for capture filename
set capture file CapName ; Set name of capture file (pieced together from above).
capture on ; Open up the capture file.
; We need to set up a "hook" to allow the capture file to be closed when a user
; stops the script.
when USEREXIT call close_capture
; Main capture loop. This is an infinite loop that grabs the current time, formats
; and dumps a time stamp string into the capture stream and then sleeps for 60 seconds
; before it does it again. This loop will run until the user stops the script or
; exits Procomm
while 1
ltimestrs $LTIME DateString TimeString
strfmt sCap "`r`nProcomm PC clock time: %s %s`n`n`r" DateString TimeString
termwrites sCap
pause 60
endwhile
endproc
proc close_capture
capture off ;close capture file
halt
endproc
proc main
string DateString, TimeString, sCap
string CapName ; Name of capture file to open.
; Grab current time and date and place them into those string variables
ltimestrs $LTIME DateString TimeString
; I found out that Procomm does not like slashes or colons in capture filenames
; so lets replace all of these offending delimiters with hyphens
strreplace DateString "/" "-" ;Replace all slashes in date string with hyphens
strreplace TimeString ":" "-" ;Replace all colons in time string with hyphens
; Now concatenate the capture filename together
strcat CapName "Procomm_Capture_"
strcat CapName DateString
strcat CapName "_"
strcat CapName TimeString
strcat CapName ".cap"
set capture overwrite on ; overwrite old capture file data with new data
set capture query off ; do not prompt user for capture filename
set capture file CapName ; Set name of capture file (pieced together from above).
capture on ; Open up the capture file.
; We need to set up a "hook" to allow the capture file to be closed when a user
; stops the script.
when USEREXIT call close_capture
; Main capture loop. This is an infinite loop that grabs the current time, formats
; and dumps a time stamp string into the capture stream and then sleeps for 60 seconds
; before it does it again. This loop will run until the user stops the script or
; exits Procomm
while 1
ltimestrs $LTIME DateString TimeString
strfmt sCap "`r`nProcomm PC clock time: %s %s`n`n`r" DateString TimeString
termwrites sCap
pause 60
endwhile
endproc
proc close_capture
capture off ;close capture file
halt
endproc