Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Alertes mail ntbackup

4 réponses
Avatar
Speckery
Bonjour a tous,

Bon j'ai toujours autant de soucis avec Ntbackup ("impossible de continuer
l'action de sauvegarde car le media n'a pas été trouvé"), et pourtant je
sauvegarde sur un lecteur réseau; A ce sujet ntbackup est il incompatible
avec des lecteurs réseaux? je commence serieusement a me poser la question!

Donc, vu la fiabilité des sauvegardes windows, existe il un systeme
d'alertes mail couplé à ntbackup (un utilitaire tierce ou autre)?

Merci a vous!

4 réponses

Avatar
Ludovik DOPIERALA
Il y en a 2 classiques
Arc Serve Bright Store et Veritas Backup Exec
--
Ludovik DOPIERALA
http://www.c2points.com
MCSE, MCT Microsoft
CCEA Citrix Metaframe




Bonjour a tous,

Bon j'ai toujours autant de soucis avec Ntbackup ("impossible de continuer
l'action de sauvegarde car le media n'a pas été trouvé"), et pourtant je
sauvegarde sur un lecteur réseau; A ce sujet ntbackup est il incompatible
avec des lecteurs réseaux? je commence serieusement a me poser la question!

Donc, vu la fiabilité des sauvegardes windows, existe il un systeme
d'alertes mail couplé à ntbackup (un utilitaire tierce ou autre)?

Merci a vous!


Avatar
Speckery
Mais pas de possibilité de coupler une alerte mail à ntbackup?


Il y en a 2 classiques
Arc Serve Bright Store et Veritas Backup Exec
--
Ludovik DOPIERALA
http://www.c2points.com
MCSE, MCT Microsoft
CCEA Citrix Metaframe




Bonjour a tous,

Bon j'ai toujours autant de soucis avec Ntbackup ("impossible de continuer
l'action de sauvegarde car le media n'a pas été trouvé"), et pourtant je
sauvegarde sur un lecteur réseau; A ce sujet ntbackup est il incompatible
avec des lecteurs réseaux? je commence serieusement a me poser la question!

Donc, vu la fiabilité des sauvegardes windows, existe il un systeme
d'alertes mail couplé à ntbackup (un utilitaire tierce ou autre)?

Merci a vous!




Avatar
Crusty AppleSniffer
Tu peux lancer NT Backup via un script.
Une fois l'exécution terminée, le script va lire le répertoire de log de NT
Backup, extraire les infos du fichier log, puis utiliser l'objet CDO pour
envoyer un email.

un exemple de script... (a sauvegarder en .wsf et à inserer dans une tache
planifiée)

-------------------------------------------------------------------------------------------------------------
<Job id="Backup">
<reference object="ADODB.Record"/> ' ADODB Type Library
<reference object="CDO.Message"/> ' Microsoft CDO for Exchange 2000 Library
<script language="VBScript">
Option Explicit

Dim objConfiguration, objFields, objMessage ' As Object
' -------------------------------------------------------------------
' Mail feature settings
' -------------------------------------------------------------------
Dim sMailServer 'This is the FQDN of your Exchange server
sMailServer = "127.0.0.1"
Dim sSendFrom 'This is the sender of the report
sSendFrom = ""
Dim sSendTo 'This is who receives the report (separate recipients with
semi-colon)
sSendTo = ""
Dim sSubject ' This is the message subject.
sSubject = "Backup Report"

Dim dbBytesTransfered
dbBytesTransfered = CDbl(0)

Dim sReport
sReport = "<HTML><BODY>"

nRet = BackupFoldersToTape("SEAGATE DAT DAT72-052 SCSI Sequential
Device", _
"C:Backupbackup.bks" , _
"MyLibrary", _
"MyTape", _
False, _
sReport, _
dbBytesTransfered)


sReport = sReport & "</BODY></HTML>"

' Send report via email
On Error resume next
Set objConfiguration = CreateObject("CDO.Configuration")
Set objFields = objConfiguration.Fields
With objFields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPServer) = sMailServer
.Item(cdoSMTPConnectionTimeout) = 600
.Update
End With

Set objMessage = CreateObject("CDO.Message")
With objMessage
Set .Configuration = objConfiguration
.From = sSendFrom
.To = sSendTo
.Subject = sSubject
.HTMLBody = sReport
.Send
If Err.Number <> 0 Then
WScript.Echo Now() & " - Report failed to be sent."
WScript.Echo Now() & " - " & Err.Description
Else
WScript.Echo Now() & " - Report sent."
End If
End With

'*********************************************************************************************
'* NAME:
'* Function BackupFoldersToTape(ByVal sLibraryName, ByVal sBKSFilename,
ByVal sTapeName,
'* ByVal sPoolName, ByVal boAppendToTape, ByRef sResult, ByRef
lTotalBytes)
'*
'* DESCRIPTION:
'* Backup the folders to the tape according to the BKS File in argument.
'* Info: Do not use notepad to generate the BKS file, but use NTBackup,
select the folers
'* you want to backup, then save the selection.
'*
'* PARAMS:
'* (in) sLibraryName: String - Name of the library
'* as displayed in the Computer management mmc
(StorageRemovable StorageLibraries)
'* (in) sBKSFilename: String - Full path name of the BKS file to use for
Backup
'* (in) sTapeName: String - Name of the tape
'* as displayed in the Computer management mmc
(StorageRemovable StorageMedia, Name column)
'* (in) sPoolName: String - Name of the pool
'* as displayed in the Computer management mmc
(the folder of StorageRemovable StorageMedia PoolBackup)
'* (in) boAppendToTape Boolean - Indicates if the Backup should be added
to the tape or if it will overwrite all previous backup
'* (in/out) sResult String - Concatenated report of backup
'* (in/out) lTotalBytes Double - Numbers of bytes processed
'*
'* RETURNS:
'* Integer - return code (0 if succeeded)
'*
'* GLOBALS:
'*********************************************************************************************
Function BackupFoldersToTape(ByVal sLibraryName, _
ByVal sBKSFilename, _
ByVal sTapeName, _
ByVal sPoolName, _
ByVal boAppendToTape, _
ByRef sResult, _
ByRef lTotalBytes)

Dim dtTaskStartTime ' as Date
Dim dtTaskEndTime ' as Date
Dim WshShell
Dim strPathToLog
Dim strAlternatePathToLog
Dim oExec
Dim oCurrentFolder
Dim itFile
Dim dtLastLogDate
Dim strLastLogFile
Dim boBackupOk
Dim intLineCount
Dim strLinetoParse
Dim strBytes

dtTaskStartTime = CDate(Now)

nRet = 0
sResult = sResult & vbCrLf & "<p>"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("rsm.exe refresh /lf""" & sLibraryName & """")

Do While (oExec.Status = 0)
WScript.Sleep(100)
Loop

nRet = oExec.ExitCode

' Wait 2 sec.
WScript.Sleep(2000)

If boAppendToTape = True Then
' Backuping folders described in sBKSFilename (append to the tape)
Set oExec = WshShell.Exec("ntbackup backup ""@" & sBKSFilename & """
/v:yes /r:no /hc:on /m normal /l:s /a /t """ _
& sTapeName & """")
Else
' Backuping folders described in sBKSFilename (format the tape before)
Set oExec = WshShell.Exec("ntbackup backup ""@" & sBKSFilename & """
/v:yes /r:no /hc:on /m normal /l:s /p """ _
& sPoolName & """ /n """ & sTapeName & """ /um")
End If

Do While (oExec.Status = 0)
WScript.Sleep(100)
Loop

nRet = oExec.ExitCode
Set WshShell = Nothing
Set oExec = Nothing


Dim WshNetwork ' as WScript.Network object
Set WshNetwork = WScript.CreateObject("WScript.Network")

' Path(s) to log file
strPathToLog = "C:Documents and Settings" & WshNetwork.UserName & "." &
WshNetwork.UserDomain _
& "Local SettingsApplication DataMicrosoftWindows
NTNTBackupdata"
strAlternatePathToLog = "C:Documents and Settings" & WshNetwork.UserName
_
& "Local SettingsApplication DataMicrosoftWindows
NTNTBackupdata"

Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")

On error resume next
Set oCurrentFolder = FSO.GetFolder(strPathToLog)
If Err.Number <> 0 Then
Set oCurrentFolder = FSO.GetFolder(strAlternatePathToLog)
End If

dtLastLogDate = DateAdd("yyyy", -1, Now)
For each itFile in oCurrentFolder.Files
If DateDiff("s", dtLastLogDate, itFile.DateLastModified) > 0 Then
dtLastLogDate = itFile.DateLastModified
strLastLogFile = itFile.Path
End If
Next

Err.Clear

strBytes = ""
Dim dbBytes
Dim itTextFile

dbBytes = CDbl(0)

Set itTextFile = FSO.OpenTextFile(strLastLogFile,1, false, -1)
If Err.Number <> 0 Then
sResult = sResult & "</p>" & vbCrLf & "<p> <Font color=red>Error Opening
Backup Log " & strLastLogFile _
& "</font><br>System returns: " & Err.Number & " " &
Err.Description & "</p>"
BackupFoldersToTape = -1
Else
boBackupOk = True
strBytes = ""
Do While itTextFile.AtEndOfStream <> True
strLinetoParse = itTextFile.ReadLine
If InStr(strLinetoParse, "The operation did not successfully complete.")
0 Then
sResult = sResult & "Error in Backup<BR>"

boBackupOk = False
' Error found
Exit Do
End If
If Left(strLinetoParse, Len("Verify of ")) = "Verify of " Then
TRACE "Backup of " & Mid(strLinetoParse, Len("Verify of "))
sResult = sResult & "Backup of " & Mid(strLinetoParse, Len("Verify of
"))
Do While itTextFile.AtEndOfStream <> True
strLinetoParse = itTextFile.ReadLine
If Left(strLinetoParse, Len("Bytes: ")) = "Bytes: " Then
strBytes = Mid(strLinetoParse, Len("Bytes: "))
sResult = sResult & ": " & strBytes & " bytes<BR>"
dbBytes = dbBytes + CDbl(strBytes)
Exit Do
End If
Loop
End If
Loop

lTotalBytes = lTotalBytes + dbBytes

dtTaskEndTime = CDate(Now)
If Not(boBackupOK) Then
' Backup Failed.
sResult = sResult & "</p>" & vbCrLf & "<p> <Font color=red>Backup
Failed</font><br>System returns: " _
& strLinetoParse & "</p>"
BackupFoldersToTape = -1
Else
sResult = sResult & "</p>" & vbCrLf & "<p>Backup " & sBKSFilename & " ("
& BytesToString(dbBytes) _
& ") to tape done in <b>" & ElapsedTimeToString(dtTaskStartTime,
dtTaskEndTime) _
& "</b></p>"
BackupFoldersToTape = nRet
End If
End If
End Function
</script>
</Job>
-------------------------------------------------------------------------------------------------------------

J'espère que cela peut t'aider.

Crusty ApppleSniffer




"Speckery" wrote in message
news:
Mais pas de possibilité de coupler une alerte mail à ntbackup?


Il y en a 2 classiques
Arc Serve Bright Store et Veritas Backup Exec
--
Ludovik DOPIERALA
http://www.c2points.com
MCSE, MCT Microsoft
CCEA Citrix Metaframe




Bonjour a tous,

Bon j'ai toujours autant de soucis avec Ntbackup ("impossible de
continuer
l'action de sauvegarde car le media n'a pas été trouvé"), et pourtant
je
sauvegarde sur un lecteur réseau; A ce sujet ntbackup est il
incompatible
avec des lecteurs réseaux? je commence serieusement a me poser la
question!

Donc, vu la fiabilité des sauvegardes windows, existe il un systeme
d'alertes mail couplé à ntbackup (un utilitaire tierce ou autre)?

Merci a vous!






Avatar
Speckery
j'essaierai ca! Merci bien!


Tu peux lancer NT Backup via un script.
Une fois l'exécution terminée, le script va lire le répertoire de log de NT
Backup, extraire les infos du fichier log, puis utiliser l'objet CDO pour
envoyer un email.

un exemple de script... (a sauvegarder en .wsf et à inserer dans une tache
planifiée)

-------------------------------------------------------------------------------------------------------------
<Job id="Backup">
<reference object="ADODB.Record"/> ' ADODB Type Library
<reference object="CDO.Message"/> ' Microsoft CDO for Exchange 2000 Library
<script language="VBScript">
Option Explicit

Dim objConfiguration, objFields, objMessage ' As Object
' -------------------------------------------------------------------
' Mail feature settings
' -------------------------------------------------------------------
Dim sMailServer 'This is the FQDN of your Exchange server
sMailServer = "127.0.0.1"
Dim sSendFrom 'This is the sender of the report
sSendFrom = ""
Dim sSendTo 'This is who receives the report (separate recipients with
semi-colon)
sSendTo = ""
Dim sSubject ' This is the message subject.
sSubject = "Backup Report"

Dim dbBytesTransfered
dbBytesTransfered = CDbl(0)

Dim sReport
sReport = "<HTML><BODY>"

nRet = BackupFoldersToTape("SEAGATE DAT DAT72-052 SCSI Sequential
Device", _
"C:Backupbackup.bks" , _
"MyLibrary", _
"MyTape", _
False, _
sReport, _
dbBytesTransfered)


sReport = sReport & "</BODY></HTML>"

' Send report via email
On Error resume next
Set objConfiguration = CreateObject("CDO.Configuration")
Set objFields = objConfiguration.Fields
With objFields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPServer) = sMailServer
.Item(cdoSMTPConnectionTimeout) = 600
.Update
End With

Set objMessage = CreateObject("CDO.Message")
With objMessage
Set .Configuration = objConfiguration
.From = sSendFrom
.To = sSendTo
.Subject = sSubject
.HTMLBody = sReport
.Send
If Err.Number <> 0 Then
WScript.Echo Now() & " - Report failed to be sent."
WScript.Echo Now() & " - " & Err.Description
Else
WScript.Echo Now() & " - Report sent."
End If
End With

'*********************************************************************************************
'* NAME:
'* Function BackupFoldersToTape(ByVal sLibraryName, ByVal sBKSFilename,
ByVal sTapeName,
'* ByVal sPoolName, ByVal boAppendToTape, ByRef sResult, ByRef
lTotalBytes)
'*
'* DESCRIPTION:
'* Backup the folders to the tape according to the BKS File in argument.
'* Info: Do not use notepad to generate the BKS file, but use NTBackup,
select the folers
'* you want to backup, then save the selection.
'*
'* PARAMS:
'* (in) sLibraryName: String - Name of the library
'* as displayed in the Computer management mmc
(StorageRemovable StorageLibraries)
'* (in) sBKSFilename: String - Full path name of the BKS file to use for
Backup
'* (in) sTapeName: String - Name of the tape
'* as displayed in the Computer management mmc
(StorageRemovable StorageMedia, Name column)
'* (in) sPoolName: String - Name of the pool
'* as displayed in the Computer management mmc
(the folder of StorageRemovable StorageMedia PoolBackup)
'* (in) boAppendToTape Boolean - Indicates if the Backup should be added
to the tape or if it will overwrite all previous backup
'* (in/out) sResult String - Concatenated report of backup
'* (in/out) lTotalBytes Double - Numbers of bytes processed
'*
'* RETURNS:
'* Integer - return code (0 if succeeded)
'*
'* GLOBALS:
'*********************************************************************************************
Function BackupFoldersToTape(ByVal sLibraryName, _
ByVal sBKSFilename, _
ByVal sTapeName, _
ByVal sPoolName, _
ByVal boAppendToTape, _
ByRef sResult, _
ByRef lTotalBytes)

Dim dtTaskStartTime ' as Date
Dim dtTaskEndTime ' as Date
Dim WshShell
Dim strPathToLog
Dim strAlternatePathToLog
Dim oExec
Dim oCurrentFolder
Dim itFile
Dim dtLastLogDate
Dim strLastLogFile
Dim boBackupOk
Dim intLineCount
Dim strLinetoParse
Dim strBytes

dtTaskStartTime = CDate(Now)

nRet = 0
sResult = sResult & vbCrLf & "<p>"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("rsm.exe refresh /lf""" & sLibraryName & """")

Do While (oExec.Status = 0)
WScript.Sleep(100)
Loop

nRet = oExec.ExitCode

' Wait 2 sec.
WScript.Sleep(2000)

If boAppendToTape = True Then
' Backuping folders described in sBKSFilename (append to the tape)
Set oExec = WshShell.Exec("ntbackup backup ""@" & sBKSFilename & """
/v:yes /r:no /hc:on /m normal /l:s /a /t """ _
& sTapeName & """")
Else
' Backuping folders described in sBKSFilename (format the tape before)
Set oExec = WshShell.Exec("ntbackup backup ""@" & sBKSFilename & """
/v:yes /r:no /hc:on /m normal /l:s /p """ _
& sPoolName & """ /n """ & sTapeName & """ /um")
End If

Do While (oExec.Status = 0)
WScript.Sleep(100)
Loop

nRet = oExec.ExitCode
Set WshShell = Nothing
Set oExec = Nothing


Dim WshNetwork ' as WScript.Network object
Set WshNetwork = WScript.CreateObject("WScript.Network")

' Path(s) to log file
strPathToLog = "C:Documents and Settings" & WshNetwork.UserName & "." &
WshNetwork.UserDomain _
& "Local SettingsApplication DataMicrosoftWindows
NTNTBackupdata"
strAlternatePathToLog = "C:Documents and Settings" & WshNetwork.UserName
_
& "Local SettingsApplication DataMicrosoftWindows
NTNTBackupdata"

Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")

On error resume next
Set oCurrentFolder = FSO.GetFolder(strPathToLog)
If Err.Number <> 0 Then
Set oCurrentFolder = FSO.GetFolder(strAlternatePathToLog)
End If

dtLastLogDate = DateAdd("yyyy", -1, Now)
For each itFile in oCurrentFolder.Files
If DateDiff("s", dtLastLogDate, itFile.DateLastModified) > 0 Then
dtLastLogDate = itFile.DateLastModified
strLastLogFile = itFile.Path
End If
Next

Err.Clear

strBytes = ""
Dim dbBytes
Dim itTextFile

dbBytes = CDbl(0)

Set itTextFile = FSO.OpenTextFile(strLastLogFile,1, false, -1)
If Err.Number <> 0 Then
sResult = sResult & "</p>" & vbCrLf & "<p> <Font color=red>Error Opening
Backup Log " & strLastLogFile _
& "</font><br>System returns: " & Err.Number & " " &
Err.Description & "</p>"
BackupFoldersToTape = -1
Else
boBackupOk = True
strBytes = ""
Do While itTextFile.AtEndOfStream <> True
strLinetoParse = itTextFile.ReadLine
If InStr(strLinetoParse, "The operation did not successfully complete.")
0 Then
sResult = sResult & "Error in Backup<BR>"

boBackupOk = False
' Error found
Exit Do
End If
If Left(strLinetoParse, Len("Verify of ")) = "Verify of " Then
TRACE "Backup of " & Mid(strLinetoParse, Len("Verify of "))
sResult = sResult & "Backup of " & Mid(strLinetoParse, Len("Verify of
"))
Do While itTextFile.AtEndOfStream <> True
strLinetoParse = itTextFile.ReadLine
If Left(strLinetoParse, Len("Bytes: ")) = "Bytes: " Then
strBytes = Mid(strLinetoParse, Len("Bytes: "))
sResult = sResult & ": " & strBytes & " bytes<BR>"
dbBytes = dbBytes + CDbl(strBytes)
Exit Do
End If
Loop
End If
Loop

lTotalBytes = lTotalBytes + dbBytes

dtTaskEndTime = CDate(Now)
If Not(boBackupOK) Then
' Backup Failed.
sResult = sResult & "</p>" & vbCrLf & "<p> <Font color=red>Backup
Failed</font><br>System returns: " _
& strLinetoParse & "</p>"
BackupFoldersToTape = -1
Else
sResult = sResult & "</p>" & vbCrLf & "<p>Backup " & sBKSFilename & " ("
& BytesToString(dbBytes) _
& ") to tape done in <b>" & ElapsedTimeToString(dtTaskStartTime,
dtTaskEndTime) _
& "</b></p>"
BackupFoldersToTape = nRet
End If
End If
End Function
</script>
</Job>
-------------------------------------------------------------------------------------------------------------

J'espère que cela peut t'aider.

Crusty ApppleSniffer




"Speckery" wrote in message
news:
Mais pas de possibilité de coupler une alerte mail à ntbackup?


Il y en a 2 classiques
Arc Serve Bright Store et Veritas Backup Exec
--
Ludovik DOPIERALA
http://www.c2points.com
MCSE, MCT Microsoft
CCEA Citrix Metaframe




Bonjour a tous,

Bon j'ai toujours autant de soucis avec Ntbackup ("impossible de
continuer
l'action de sauvegarde car le media n'a pas été trouvé"), et pourtant
je
sauvegarde sur un lecteur réseau; A ce sujet ntbackup est il
incompatible
avec des lecteurs réseaux? je commence serieusement a me poser la