Hi group...
Wondering if you could help me...
I have an admin web site that we use on one of our win 2000 servers running IIS to run checkpoints(db backups) and tape backups (using ntbackup).
OK so ntbackup is not the best backup routine to use but it works for our purposes...
Here is what we have :
1. First we have a windows batch file that does the work DAILY_DB_BACKUP.BAT:
@ echo off
:: DAILY_DB_BACKUP.BAT
::
:: Description : This windows batch file calls a vbscript file to backup the ingres
:: databases on this host. The vbscript file will call ntbackup to
:: backup the checkpoint, journal and dump areas of the file system
::
:: first cleanup any old backups. Any files older than 5 days will be deleted
::
::
::
rem we refresh the rsm database to recognise a media change
start /wait rsm refresh /lf"Compaq DDS4 20/40 GB DAT Drive"
::
:: now call the vbscript that does the backup to tape
::
rem we pass in the user profile directory so that ntbackup logfile can be found
c:\WINNT\system32\cscript.exe E:\DBA\BIN\daily_dbs_backup.vbs "%userprofile%"
2. We have COM call this batch script. Here is the
VB code within COM that allows the call to the windows batch script:
Public Sub backup_dbs_to_tape()
''* Date : July, 2003
'*
'*
'* Description : Does a Backup of All the ingres databases on the server. This is
'* done by calling a batch script on the server called daily_db_backup.bat
'*
'*
'* Parameters : IN
'* DBA_TOP_DIR - set via asp page by call to isip_dba_dir, DBA home directory on the server
'*
'************************************************* ****************************
Dim oFSO As New Scripting.FileSystemObject
Dim f_FileResult As String
Dim oWshShell, f_Result As String, f_FullCommand As String, f_EXEPath As String
Dim WaitUntilFinished As Boolean
Dim strCommand As String
Dim StrLogFile As String
'--------------------------------------------------------------------
localerroroutput = "" ' reset the error messages to indicate no errors
' set path to batch script to be run to backup the databases
StrLogFile = DBA_TOP_DIR & "\LOG\dbs_to_tape.log"
f_EXEPath = DBA_TOP_DIR & "\BIN\"
' backup in ingres databases on the server
strCommand = "daily_db_backup.bat"
WaitUntilFinished = True
On Error GoTo backupfail
'--------------------------------------------------------------
' Execute the backup batch file on the server
'--------------------------------------------------------------
'------------------------------------------------------------------------------
' Create an instance of the Windows Scripting Host to RUN the batch
'------------------------------------------------------------------------------
Set oWshShell = CreateObject("WScript.Shell")
' we use COMSPEC which is an environment variable to run our batch script.
' COMSPEC is an environment variable that should
' be set by windows to something like e.g. C:\WINNT\system32\cmd.exe. The /c switch tells the command line
' interpretor to exit after it has run the command
' NOTE : this is a good way of creating a wrapper to capture the output of a WSH command
f_FullCommand = "%COMSPEC% /c " & f_EXEPath & strCommand & " > " & StrLogFile
Debug.Print "Full command : " & f_FullCommand
f_Result = oWshShell****n(f_FullCommand, 1, WaitUntilFinished)
Set oWshShell = Nothing
If f_Result <> 0 Then
GoTo backuperr
End If
'--------------------------------
' Create optional result report
'--------------------------------
tempstring = ""
tempstring = tempstring & "WshShell Result = " & f_Result & vbCrLf
tempstring = tempstring & f_FileResult & vbCrLf
tempstring = tempstring & "Command Executed = " & strCommand & vbCrLf
tempstring = tempstring & "Full Command Executed: " & f_FullCommand & vbCrLf
Exit Sub
backuperr:
On Error Resume Next
Debug.Print "backup_dbs_to_tape() - An error has been found"
localerroroutput = localerroroutput & "backup_dbs_to_tape() - Error: "
errorhandle ' get the standrad
VB errors
Exit Sub
backupfail:
On Error Resume Next
Debug.Print "backup_dbs_to_tape() - An error has been found"
localerroroutput = "backup_dbs_to_tape() - Failed to backup ingres databases"
Exit Sub
End Sub
3. The COM function is called from an ASP page :
'run the copy of the databases to tape
on error resume next ' we handle COM errors ourselves
set db_admin = server.createobject("admindba.admincls")
db_admin.Ingres_Home_Dir = session("ingres_root_dir")
db_admin.isip_database = session("sess_ckp_db")
db_admin.isip_database_jnl_flag = session("sess_jnl_flag")
session("backup_outcome") = ""
session("backupresult") = ""
call UpdateProgress ' Update Progress bar on client
' set the name of the root directory for DBA files
db_admin.isip_dba_dir = session("str_dba_top_dir")
call UpdateProgress ' Update Progress bar on client
' we can do the backup now of the ingres databases to tape
db_admin.backup_dbs_to_tape ' RUN THE BACKUP OF DATABASES TO TAPE
if db_admin.erroroutput <> "" or err.number <> 0 then
session("backup_outcome") = "Unable to backup Ingres Databases to Tape : "
session("backupresult") = "Backup to Tape Error : " & db_admin.erroroutput & vbCR & _
db_admin.textstr
else
' we are ok
session("backup_outcome") = "Successful Backup of Ingres Databases to Tape"
session("backupresult") = "Backup to Tape Success : " & db_admin.textstr
end if
Now hopefully you follow exactly what I've done....
The problem is that the ASP page above times out. So far I have :
1. set the connection timeout within IIS to 14,400 which is more than enough as the backup only takes just over 1 hour
2. set the "leave running when idle" option within COM under the "advanced" of the properties of the COM component
I'm unsure what is causing the timeout and that's what I need to know as I figure that I've set IIS and COM not to timeout in under 2 hours....
Do I have to simply kick off the vbscript and instead not wait until it's complete and forward to a page that will do an autorefresh and display the backup log file ??? I know I can do this but I REALLY REALLY want to know what is causing the timeout in the first place before I start looking at other options...
Thanks in advance and I'm sure may people have encountered this problem before....