Macrium Support Forum

This forum is for Version 5 of Macrium Reflect.
Version 6 users should join our new forum here.

Version 5 support expired on 17 February 2016.

Find out more
Macrium Support Forum
Macrium Support Forum    RSS 2.0  RSS Feed      KB
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 Reflect v4
 Wish List
 Email notification
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

grobi
Starting Member

Germany
1 Posts

Posted - February 10 2011 :  09:43:16  Show Profile
Hello,

to keep an eye on serveral servers all of them doing there backup with macrium reflect is a bit costly. Why not having an email notification after finishing the backup.

best regards
ralf grothusen

Jede Dummheit findet einen, der sie macht. (T. Williams)

C.Bamford
Moderator

United Kingdom
1002 Posts

Posted - February 10 2011 :  09:46:35  Show Profile
Hi,

Thanks for contacting us.

The current version of Macrium Reflect employs VBScript to enable customers to send emails on backup completion, please see the following KB article:
http://www.macrium.com/KB/KnowledgebaseArticle50055.aspx

Kind regards.

Chris.

Macrium Support
Go to Top of Page

VBDavie
New Member

33 Posts

Posted - July 01 2011 :  00:22:50  Show Profile
More specifically, you can control the PORT numbers and passwords etc.. Here is an example that "I" use form my email notifications.


'******************************************************************************
'*
'*
'* Module Name: My Backup 8-3 inc 1.vbs
'*
'* Abstract: This is a template VB Script file generated by Reflect v4.2
'* Modify to add your own functionality if required
'*
'*
'******************************************************************************

OPTION EXPLICIT

' call the main function
Call VBMain()


'******************************************************************************
'* Sub: VBMain
'*
'* Purpose: This is main function to start execution
'*
'* Input: None
'*
'* Output: None
'*
'******************************************************************************
Sub VBMain()
Dim objShell
Dim ExitCode

' The following function call ensures that this script only runs once a day
If HasRunToday Then
WScript.Quit
End If

Set objShell = WScript.CreateObject("WScript.Shell")

' Do the backup
ExitCode = Backup ("""G:\Program Files\Macrium\Reflect\reflect.exe"" -e -w ""G:\Documents and Settings\Davie\My Documents\Reflect\My Backup 8-3 inc 1.xml""")

' done
Set objShell = nothing
wscript.quit(ExitCode)
End Sub

'******************************************************************************
'* Function: Backup
'*
'* Purpose: Calls Reflect.exe passing an XML BDF as a parameter
'* Optionaly logs output to file
'*
'* Input: strCmdLine Command Line Arguments
'* Output: Exit Code
'*
'******************************************************************************
Function Backup(Byref strCmdLine)
Dim objShell
Dim objExecObject
Dim strLine
Dim objFS
Dim objNewFile
Dim strLogFileName


' Run the backup or image
Set objShell = WScript.CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec(strCmdLine)

' Log to file
strLogFileName = "G:\Documents and Settings\Davie\My Documents\Reflect\log-" & Year(Date) & "-" & Month(Date) & "-" & Day(Date) & " " & Hour(Time) & "." & Minute(Time) & "." & Second(Time) & ".txt"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objNewFile = objFS.OpenTextFile(strLogFileName , 8, 1)
Do Until objExecObject.StdOut.AtEndOfStream
strLine = objExecObject.StdOut.ReadLine()
If Instr(strLine , "%") = 0 Then
objNewFile.WriteLine strLine
end if
Loop

objNewFile.Close
set objFS = nothing

' Wait for the process to finish
Do While objExecObject.Status = 0
WScript.Sleep 100
Loop

if objExecObject.exitcode = 2 then
' Handle XML validation error

elseif objExecObject.exitcode = 1 then
' Handle backup error
SendEmail "Macrium Reflect - Backup Failed", "Type your email message here for a failed backup", strLogFileName
objShell.LogEvent 1, "Macrium Reflect - Backup Failed"
elseif objExecObject.exitcode = 0 then
' Everything OK
objShell.LogEvent 0, "Macrium Reflect - Successful Backup"
SendEmail "Macrium Reflect - Successful Backup", "Type your email message here for a successful backup", strLogFileName
end if
Backup = objExecObject.exitcode
Set objExecObject = nothing
Set objShell = nothing
End Function

'******************************************************************************
'* Function: HasRunToday
'*
'* Purpose: determines if this script has run today
'*
'*
'* Input: None
'* Output: true if has run today false otherwise
'*
'******************************************************************************
Function HasRunToday
Dim RegScriptKey
Dim LastRunDate
Dim objShell

Set objShell = WScript.CreateObject("WScript.Shell")
RegScriptKey = "HKCU\SOFTWARE\Macrium\Reflect\Scripts\" & WScript.ScriptFullName & "\LastRun"

'Check if script has run today
ON ERROR RESUME NEXT
LastRunDate = objShell.RegRead(RegScriptKey)
If LastRunDate = cstr(Date) Then
HasRunToday = true
Else
objShell.RegWrite RegScriptKey, Date,"REG_SZ"
HasRunToday = false
End If
Set objShell = nothing
End Function


'******************************************************************************
'* Sub: SendEmail
'*
'* Purpose: Uses CDO to send an email message
'*
'* Input: strSubject subject text
'* strBody main body of the email
'* strLogFileName file name of the log file to attach to the email
'* Output: None
'*
'******************************************************************************
Function SendEmail(ByRef strSubject, _
ByRef strBody, _
ByRef strLogFileName)
Dim objMessage

Set objMessage = CreateObject("CDO.Message")

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.networkservices.com"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/SMTPServerPort")=587
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/SMTPAuthenticate")=1
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/SendUserName")="xxxxxx"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/SendPassword")="mypassword"


objMessage.Configuration.Fields.Update

objMessage.Subject = strSubject
objMessage.From = "xxxxxx@smatters.com"
objMessage.To = "xxxxxx@smatters.com"
objMessage.TextBody = strBody
objMessage.AddAttachment strLogFileName
objMessage.Send
Set objMessage = nothing
End Function
quote:



So, if you look near the bottom, you will see "SMTPServerPort" that is the area where you can see all the customizations that I set up to send my emails. I think the standard port is like 25 or 110 or something like that, but a number of ISPs now use 587

Hope this clears things up for you.

Davie

Thanks in advance
Davie
creator of Photo Jockey www.photojockey.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Macrium Support Forum © Paramount Software UK Ltd Go To Top Of Page
This page was generated in 0.56 seconds. Snitz Forums 2000