;************************************************************************ ;* ;* telnet to iii server, then verify backup tape ;* version 1.2 ;* ;* This program does not give any, explicit or implicit, warranty. ;* The author is not responsible for any inadvertence as a result of ;* using this program. ;* ;* Please make necessary changes in areas marked by **Customize: **. ;* Please make sure all the inputs match the correct input series and ;* sequence required for your Verfy process whereever appropriate. ;* The extention of this script file must be ".ttl". ;* ;* usage: ttermpro /m=iii_backup_verif_12 ;* usage: ttermpro /m=iii_backup_verif_12 /i ;* (The above two both work. When running with the second, the session ;* window does not show on your desktop, instead it shrinks into an ;* icon in the Taskbar at the bottom of the screen.) ;* (If you use Windows "Scheduled Tasks" to launch this scropt, in the ;* "Run:" box, fill in ;* "C:\Program Files\TTERMPRO\ttermpro.exe" /m=iii_backup_verif_12 ;* Please modify the above statement to reflect where you install the ;* Tera Term software.) ;* ;* Phil Huang, Sonoma State University, Nov. 2007 ;* ;************************************************************************* ; **Customize: use the ip of your server** connect '130.157.51.249' ; If unable to make a connection (wrong ip, server too busy, etc.), the ; system variable "result" gets 1. if result = 1 goto ConnectionFailure ; login wait 'login:' ; **Customize: use your login username** sendln 'wxyz' wait 'Password:' ; **Customize: use your password** sendln 'abcd' ; login complete gettime Stamp getdate DateStr strconcat Stamp ', ' strconcat Stamp DateStr wait 'A,I,Q)' send 'A' wait 'A,O,Q)' send 'B' ; secondary login ; **Customize: use your second login username** sendln 'HouseKeeper' ; **Customize: use your second password** sendln 'WorkHorse' wait 'U,T,Q)' send 'U' wait 'E,V,Q)' send 'V' ; the following paragraph is added to see if the previous day ; backup is completed. Nov. 19, 2003 timeout = 5 ; get the "01 > " line on the screen into the string "inputstr" ; "63" and "0" are used based on test results. waitrecv "01 > " 63 0 ; see if the string "inputstr" contains "COMPLETE". If false, "result" gets 0. strscan inputstr "COMPLETED" if result = 0 goto BackupNotCompleted wait 'F,J,Q)' send 'Q' wait 'E,V,Q)' send 'Q' wait 'U,T,Q)' send 'V' wait 'D,F,Q)' send 'F' wait '(C,Q)' send 'C' ; At SSU, it normally takes less than 3600 seconds. ; **Customize: use a time reasonably longer than what you expect** timeout = 4000 wait 'Successful' ; time and date stamp, in the format "HH:MM:SS, YYYY-MM-DD" gettime Stamp strconcat Stamp ', ' strconcat Stamp DateStr ; If time exceeds what you expect, the system variable "result" gets 0. ; If 'Successful' matched, "result" gets 1. if result = 0 goto Problem wait ' to continue' send ' ' send ' ' send 'Q' send 'Q' send 'Q' send 'Q' ; Give status indication with time stamp in a pop-out window MessageOk = 'All verified Ok. ' strconcat MessageOk Stamp beep messagebox MessageOk 'Verify Completed' end :Problem ; Give a warning message with time stamp in a pop-out window MessageTimeOut = 'Process took too long. Possible PROBLEM. Check! ' strconcat MessageTimeOut Stamp beep messagebox MessageTimeOut 'WARNING' end :BackupNotCompleted ; Give a warning message with time stamp in a pop-out window MessageError = 'Backup of previous day NOT COMPLETED. Check! ' strconcat MessageError Stamp beep messagebox MessageError 'WARNING' end :ConnectionFailure ; Give an error message in a pop-out window MessageError = 'Unable to connect to the server' beep messagebox MessageError 'Connection Failure' end