<?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 Morgan &#187; Ntbackup</title>
	<atom:link href="http://andrewmorgan.ie/tag/ntbackup/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewmorgan.ie</link>
	<description>Grumpy ramblings</description>
	<lastBuildDate>Fri, 30 Jun 2017 09:24:25 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>Ntbackup part: 3 Rolling out the job.</title>
		<link>http://andrewmorgan.ie/2008/08/ntbackup-part3-rolling-out-the-job/</link>
		<comments>http://andrewmorgan.ie/2008/08/ntbackup-part3-rolling-out-the-job/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 07:41:56 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[NT Backup]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Ntbackup]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=102</guid>
		<description><![CDATA[In the previous two articles I have covered off how to backup your servers to one file share and script a scheduled task to automate the process. Now what we have to do is copy the backup.bat out to each C: drive of every server, and create our scheduled task on each server. There are many reasons I have decided to do this process manually. Leaving the backup.bat on the c: drive will allow for easy maintenance of the backups [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.teamapproach.ca/trouble/images/ntbackup.jpg"><img class="alignright" src="http://www.teamapproach.ca/trouble/images/ntbackup.jpg" alt="" width="52" height="51" /></a><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--></p>
<p class="MsoNormal">In the previous two articles I have covered off how to backup your servers to one file share and script a scheduled task to automate the process. Now what we have to do is copy the backup.bat out to each C: drive of every server, and create our scheduled task on each server.</p>
<p class="MsoNormal">There are many reasons I have decided to do this process manually. Leaving the backup.bat on the c: drive will allow for easy maintenance of the backups on each server for adding/removing backups. The second reason is the servers you wish to backup will need different drives backed up!</p>
<p class="MsoNormal">Once you have copied the custom backup.bat to the c drive of all your servers its now time to schedule the task…this is a simple and painless script that can also be reverse engineered to delete the job.</p>
<p class="MsoNormal">Place all your server names in a text file called servers.txt one per line and place it to the c: drive root e.g. c:. Once created, kick off a CMD prompt as a user with admin rights on the servers.</p>
<p class="MsoNormal">Now using the for command:</p>
<p class="MsoNormal" style="padding-left:30px;">FOR /F &#8220;tokens=* delims=: &#8221; %%i in (c:servers.txt) do schtasks /create /s %%i /u domainusername /p password /tn Server-Backup /tr “c:backup.bat” /sc daily /st 19:00:00</p>
<p class="MsoNormal">This will contact each server, one by one, and create your schedueled task to run every day at 7pm. Make sure to change the domain username and password to match your own environment.</p>
<p>Agus sin é.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/08/ntbackup-part3-rolling-out-the-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NtBackup Part:2 schedueling a task via cmd.</title>
		<link>http://andrewmorgan.ie/2008/08/nt-backup-part2-adding-a-schedueled-task-via-cmd/</link>
		<comments>http://andrewmorgan.ie/2008/08/nt-backup-part2-adding-a-schedueled-task-via-cmd/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 09:43:13 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[NT Backup]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Ntbackup]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=83</guid>
		<description><![CDATA[As part of an ntbackup script i began recently, I needed to look at how to schedule tasks from remotely. I had some experience using at.exe but seeing as schtasks seems to be the new tool i decided to give it a lash. Almost immediately i ran into problems, if i was to specify a username and password for the job to run as, the script demanded a system name&#8230; why ask for a system name if you want to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright" src="http://www.teamapproach.ca/trouble/images/ntbackup.jpg" alt="" width="52" height="51" />As part of an ntbackup script i began recently, I needed to look at how to schedule tasks from remotely. I had some experience using at.exe but seeing as schtasks seems to be the new tool i decided to give it a lash.</p>
<p>Almost immediately i ran into problems, if i was to specify a username and password for the job to run as, the script demanded a system name&#8230; why ask for a system name if you want to run it locally i wondered, but with using the %computername% variable it allowed me to run this locally.</p>
<p>schtasks /create /s %computername% /u domainusername /p Password /tn Server-Backup /tr &#8220;c:backup.bat&#8221; /sc daily /st 09:00:00</p>
<p>the above schedules backup.bat to run as whatever user you specify, it will display as &#8220;Server-Backup&#8221; in scheduled tasks and will run daily for ever.</p>
<p>Below is an example of what you should see in scheduled tasks:</p>
<p><a href="/wp-content/uploads/2008/08/schtask2.jpg"><img class="alignnone size-full wp-image-99" src="/wp-content/uploads/2008/08/schtask2.jpg" alt="" width="495" height="134" /></a></p>
<p>Check the next post for information on how to roll this out to multiple servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/08/nt-backup-part2-adding-a-schedueled-task-via-cmd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ntbackup Part 1: Scripting Nt backup</title>
		<link>http://andrewmorgan.ie/2008/08/ntbackup-part-1-scripting-nt-backup/</link>
		<comments>http://andrewmorgan.ie/2008/08/ntbackup-part-1-scripting-nt-backup/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 06:57:53 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[NT Backup]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Ntbackup]]></category>

		<guid isPermaLink="false">http://andymorgan.wordpress.com/?p=88</guid>
		<description><![CDATA[With the cost of newer backup software being very pricey to the small organization, its a wonder that the beautifully simple solution that is NTbackup has been overlooked so many times! Nt backup isn&#8217;t pretty, it can be a little temperamental and requires you to keep on top of it at all times&#8230; but so is every other product on the market. I have chosen to keep a network location for all the backups you will create for your servers, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.teamapproach.ca/trouble/images/ntbackup.jpg"><img class="alignright" src="http://www.teamapproach.ca/trouble/images/ntbackup.jpg" alt="" width="52" height="51" /></a>With the cost of newer backup software being very pricey to the small organization, its a wonder that the beautifully simple solution that is NTbackup has been overlooked so many times!</p>
<p>Nt backup isn&#8217;t pretty, it can be a little temperamental and requires you to keep on top of it at all times&#8230; but so is every other product on the market.</p>
<p>I have chosen to keep a network location for all the backups you will create for your servers, this will aid in organizing log files, and backing up each daily backup from one resource. There are so many options available, with incremental s, dailies, full and shadow copies i have decided to keep it simple with full backups daily, but once you have an idea of how the script works theres nothing stopping you from configuring it to suit yourself.</p>
<p>To kick off the guts of this three parter I&#8217;ll start with writing the script you will need to backup your infrastructure to a single disk space.</p>
<p><span id="more-88"></span></p>
<p>Well to begin, lets start with some simple variables:</p>
<p style="padding-left:30px;">set logfiledir=&#8221;%userprofile%Local SettingsApplication DataMicrosoftwindows ntNTBackupdata&#8221;<br />
set logdest=ient1dfs002j$backupslogs<br />
set backdes=ient1dfs002j$backups</p>
<p style="padding-left:30px;">FOR /F &#8220;usebackq tokens=1-4 delims=/ &#8221; %%d IN (`date /t`) DO set cdate=%%d%%e%%f<br />
FOR /F &#8220;usebackq tokens=1,2 delims=: &#8221; %%t IN (`time /t`) do set ctime=%%t%%u<br />
del /q %logfiledir%*.log</p>
<p>well with the above, i am specifying that the %logfiledir% is where ntbackup saves its log files. i will use this var to copy the log files out and have them available for a quick &#8220;once a day&#8221; review to make sure the backups ran. %logdest% &amp; %backdes% are variables for defining where you are going to store your log files, and backup files respectively.</p>
<p>The two For commands are used to create a cdate and ctime variable for the current date and time, we will use this to rename the files later on in the script.</p>
<p>the del statement simply cleans up the log file dir before we begin to ensure there are no old logs.</p>
<p style="padding-left:30px;">Rem &#8212; System state backup &#8212;</p>
<p style="padding-left:30px;">ntbackup backup systemstate /f %backdes%%computername%-systemstate-%cdate%.bkf /j &#8220;systemstate&#8221; /l:s<br />
FOR /F &#8220;usebackq tokens=1&#8243; %%n IN (`dir %logfiledir% /b`) DO ren %logfiledir%%%n %computername%-&#8220;systemstate&#8221;-%cdate%.log<br />
move /y %logfiledir%*.log %logdest%</p>
<p>Kicking off with systemstate, ntbackup runs taking a snapshot of the servers system state and saving it as servername-systemstate-date.bkf in the folder you defined in %backdes%.</p>
<p>The for statement after the script may look a little strange, this is old code i have used before to save a file using the date and time as a file name. all this simply says is: for all the files in %logfiledir% rename them to servername-systemstate-date.log</p>
<p>Once the file is renamed, the script moves the logfile off to the %logdest%, creating a report of your system state backup.</p>
<p style="padding-left:30px;">Rem &#8212; hard drive backup &#8212;<br />
Rem &#8212; Copy and paste from here downwards for multiple drives&#8212;<br />
ntbackup backup <strong>c:</strong> /f %backdes%%computername%-<strong>cdrive</strong>-%cdate%.bkf /j &#8220;<strong>C Drive</strong>&#8221; /l:s</p>
<p style="padding-left:30px;">FOR /F &#8220;usebackq tokens=1&#8243; %%n IN (`dir %logfiledir% /b`) DO ren %logfiledir%%%n %computername%-&#8220;<strong>Cdrive</strong>&#8220;-%cdate%.log<br />
move /y %logfiledir%*.log %logdest%<br />
Rem &#8212; end copy &#8212;</p>
<p>Now the above is a drive backup, as with the last portion, the script kicks off a backup of the system drive c: calling the file computername%-cdrive-date.bkf saving it in %backdes%. Once the backup is complete it will rename the logfile to servername-&#8220;Cdrive&#8221;-date.log and move it to the logdest folder.</p>
<p>if you wish to backup more than one drive, i.e. C:, D: and E: simply copy and paste from the Rem&#8217;s specified above changing the bold text.</p>
<p>And thats it! you now have a fully functioning backup script that will backup system state and the drives you specify and will save them in a network folder for you to commit to tape, or move off site each day.</p>
<p>The script in full is available <a href="http://www.4shared.com/file/59861403/c92d200c/backup.html">here:</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2008/08/ntbackup-part-1-scripting-nt-backup/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
