<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Andrew Taylor &#187; Programming</title>
	<atom:link href="http://www.andrewtaylor.me.uk/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andrewtaylor.me.uk</link>
	<description></description>
	<lastBuildDate>Wed, 28 Apr 2010 18:02:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Email NTBackup log files</title>
		<link>http://www.andrewtaylor.me.uk/blog/2008/01/email-ntbackup-log-files/</link>
		<comments>http://www.andrewtaylor.me.uk/blog/2008/01/email-ntbackup-log-files/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 18:47:32 +0000</pubDate>
		<dc:creator>ataylor</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://www.andrewtaylor.me.uk/blog/2008/01/email-ntbackup-log-files/</guid>
		<description><![CDATA[Something I&#8217;ve needed to do recently in the day job is to email the log file of NTBackup to a designated person for checking daily. A scheduled tape backup runs every night at midnight and the resulting log file needs to be sent to the business IT helpdesk to check that the backup completed successfully. [...]]]></description>
			<content:encoded><![CDATA[<p>Something I&#8217;ve needed to do recently in the day job is to email the log file of NTBackup to a designated person for checking daily. A scheduled tape backup runs every night at midnight and the resulting log file needs to be sent to the business IT helpdesk to check that the backup completed successfully.</p>
<p>Having searched around the web for a bit I couldn&#8217;t find anything that did exactly what I wanted as one vbscript and not multiple batch files, or just pseudo code. So I&#8217;ve written my own; the code is below and can be freely used as long as the acknowledgement remains.</p>
<p>Some bits need customising, such as the to and from address for the email, the location of the log files and the SMTP server address, but it should be obvious where to make the changes.</p>
<p>The script emails the log file which has the same &#8216;last modified&#8217; date as the current date, so needs to be run the same day as the backup log is created (i.e. not 7am after an 11pm backup the day before). That can probably be tweaked however. If no file is found with the same date, no email is sent. Again this could be tweaked to send an email saying so.</p>
<p>You&#8217;ll need to schedule this script to run after the backup is known to have completed (or failed). Say 7am for a midnight backup schedule. Any queries, feel free to <a href="/contact-me/">contact me</a> and I&#8217;ll do my best to answer.</p>
<p><span id="more-99"></span></p>
<p>Get the script <a href="http://www.andrewtaylor.me.uk/wp-content/uploads/emailbackuplog.txt">here</a>. Save as a .vbs file and run using &#8216;cscript emailbackuplog.vbs&#8217;.</p>
<p>To specify a user name and password for SMTP authentication, add the following with the other <code>oCDO.Configuration.Fields.Item</code> entries.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">oCDO.Configuration.Fields.Item _
		(<span style="color: #800000;">&quot;http://schemas.microsoft.com/cdo/configuration/smtpauthenticate&quot;</span>) = _
			1
&nbsp;
	oCDO.Configuration.Fields.Item _
		(<span style="color: #800000;">&quot;http://schemas.microsoft.com/cdo/configuration/sendusername&quot;</span>) = _
			<span style="color: #800000;">&quot;username&quot;</span>
&nbsp;
	oCDO.Configuration.Fields.Item _
		(<span style="color: #800000;">&quot;http://schemas.microsoft.com/cdo/configuration/sendpassword&quot;</span>) = _
			<span style="color: #800000;">&quot;password&quot;</span></pre></div></div>

<p>Comments and modifications welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewtaylor.me.uk/blog/2008/01/email-ntbackup-log-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

