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

Capture file daily..

Status
Not open for further replies.

sramelyk

Technical User
Sep 11, 2003
25
US
I want to be able to have a capture file running constantly, only stopping to save every night at midnight. I believe I can figure out the "capture on" "capture off" part of the script, but am unsure how to specify time.. Other that the 'waitfor' command. Can anyone help?
 
You can use the when $DATE command to call a procedure every midnight when the date changes. The command would look like this:

when $DATE call proc_name

which would call a procedure called proc_name that would look something like this:

proc proc_name
capture off
<perform other commands here>
capture on
endproc

aspect@aspectscripting.com
 
I wrote a script that executes through the Scheduler that renames the capture file daily. I use a different capture file for each file transfer. This file will date stamp the capture file name.




proc main


integer Month, Day ; Integers to contain date and
integer Year, Hour ; time converted from long
integer Min, Sec ; date and time.
string MonStr, DayStr ; hold day and month in string format
string FileName="capture file name here"
string FName="capture file name here"
; Convert long time value into it's counter parts, year,
; month, day, hour, min, and sec.
ltimeints $LTIME Year Month Day Hour Min Sec
; Convert integer values into string values with a length of 2 characters
strfmt MonStr "%02d" Month
strfmt DayStr "%02d" Day
; Insert month and date strings into generic file string
strinsert FName MonStr 20 2
strinsert FName DayStr 22 2
if not rename FileName FName ; Rename the file
endif


endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top