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!

Scripting daily backups on DMS-100 1

Status
Not open for further replies.

djspider74

Technical User
Sep 5, 2002
3
US
Hello,
I am working on another lazyness project for my daily routines. I'd like to be able to capture 2 strings, which are noted below, and then transmit it with 3 different endings tagged on the end. I've been able to get my OMRS reports scripted out to excel, but strings and stuff and I still dont get along too well. Here is the workflow:

>autodump status -enter this command to get the
current backup file

Successful Image: S020904230541_XA
Taken: 2002/09/04 23:05:45.023 WED.
On Volume: F02LIMG

-switch dumps this and some more data. I need to grab the S string from the top line but not the _XA, I also need the F02LIMG

>lf F02LIMG -then I need to use it with
>ba file S020904230541_XA these commands
>ba file S020904230541_MS
>ba file S020904230541HIS

Any help would be greatly appreciated.

Thanks,
Eric
 
If the format of the results from the autodump status command is relatively stable (only the content after the semicolons change), then the following script may work for you. You'll need to add some transmit statements at the end of the script to send the formatted commands in the sCommand1 through sCommand4 variables. This will probably require using some waitfor/transmit statements so that the script only sends the strings at the appropriate time.

proc main

string sInput, sFile, sVol
string sCommand1, sCommand2, sCommand3, sCommand4
integer iLen

transmit "autodump status"
waitfor "Successful Image:" FOREVER
rget sInput
strlen sInput iLen
while iLen > 0 ;While the string has at least one character in it...
if rstrcmp sInput " " 1 ;Compare the first character in the string to a space
strdelete sInput 0 1 ;If the first character is a space, delete it from the string
else
exitwhile ;Else exit the while loop
endif
endwhile
strtok sFile sInput "_"

waitfor "On Volume:" FOREVER
rget sVol
strlen sInput iLen
while iLen > 0 ;While the string has at least one character in it...
if rstrcmp sVol " " 1 ;Compare the first character in the string to a space
strdelete sVol 0 1 ;If the first character is a space, delete it from the string
else
exitwhile ;Else exit the while loop
endif
endwhile

sCommand1 = "lf "
strcat sCommand1 sVol
strcat sCommand1 "^M"
sCommand2 = "ba file "
strcat sCommand2 sFile
sCommand3 = sCommand2
sCommand4 = sCommand2
strcat sCommand2 "_XA^M"
strcat sCommand3 "_MS^M"
strcat sCommand4 "HIS^M"
endproc
aspect@aspectscripting.com
 
Hello,

I work in a DMS 100 and use DRCI to do Supernode Backups. Haven't written one Yet; but nows a good time to start. DRCI in the DMS is a Super Set of SFDEV Commands.

Let me see what I can Do. You're in a XA Core Switch; but converting the Script from Supernode to XA Core should be Simple.

Hank
 
I took the script from above and modified it so that it works wonderfully! The only problem I had was that I had to run the string query twice to get it to pick up both the image name and the volume, but that was minimal. Here is the finished product....

Thanks again!
Eric

proc main

string sInput, sFile, sVol, tapevol, tapevolf
string sCommand1, sCommand2, sCommand3, sCommand4
integer iLen

sdlginput "Backup Tape Location" "Tape is in F02UTAPE or F17UTAPE?" tapevol

transmit "quit all^M"
waitfor ">"

transmit "autodump status^m"
waitfor "Last Image:" FOREVER
rget sInput
strlen sInput iLen
while iLen > 0 ;While the string has at least one character in it...
if rstrcmp sInput " " 1 ;Compare the first character in the string to a space
strdelete sInput 0 1 ;If the first character is a space, delete it from the string
else
exitwhile ;Else exit the while loop
endif
endwhile
strtok sFile sInput "_"
transmit "autodump status^m"
waitfor "On Volume:" FOREVER
rget sVol
strlen sInput iLen
while iLen > 0 ;While the string has at least one character in it...
if rstrcmp sVol " " 1 ;Compare the first character in the string to a space
strdelete sVol 0 1 ;If the first character is a space, delete it from the string
else
exitwhile ;Else exit the while loop
endif
endwhile

sCommand1 = "lf "
strcat sCommand1 sVol
strcat sCommand1 "^M"
sCommand2 = "ba file "
strcat sCommand2 sFile
sCommand3 = sCommand2
sCommand4 = sCommand2
strcat sCommand2 "_XA^m"
strcat sCommand3 "_MS^m"
strcat sCommand4 "HIS^m"


tapevolf = tapevol
strcat tapevol "^M"
strcat tapevolf " writelabel imgbup^M"

transmit "diskut^M"
pause 2
transmit "it^m"
waitfor ">"
transmit tapevolf
pause 1
transmit "y^M"
waitfor ">"
transmit sCommand1
waitfor ">"
pause 2
transmit sCommand2
pause 1
transmit tapevol
waitfor ">" FOREVER
pause 2
transmit sCommand3
pause 1
transmit tapevol
waitfor ">" FOREVER
pause 2
transmit sCommand4
pause 1
transmit tapevol
waitfor ">" FOREVER
transmit "quit all^M"
endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top