March 7th, 2010
Windows provides the following backup tools:
- File backup: Windows Backup allows you to make copies of data files. You can let Windows choose what to back up or you can select the individual folders, libraries, and drives that you want to back up. By default, your backups are created on a regular schedule. You can change the schedule and you can manually create a backup at any time. Once you set up Windows Backup, Windows keeps track of the files and folders that are new or modified and adds them to your backup. To set up file backup, see the following backup steps
Read more »
Tags: automated, image, previous versions, shadow copies, windows, Windows 7
Posted in FAQ, Windows 7
» No Comments
November 19th, 2009
The windows 7 Backup and Restore console do not allow you to schedule Image backups :( On the other hand, ad hoc manual Image backups can be performed!
System Image Backup
However, in Windows 7 you can use the Wbadmin command-line utility to perform scheduled clones (snapshots) of your PC! The normal backup rules need to be observed before using this utility and these are:
- The destination location should be a second internal hard drive, an external hard drive, a network shared drive or multiple DVDs – not recommended/feasible
- The destination drive should be formatted with NTFS file system – windows 7 default
- Adequate space is available on the destination drive – equal to the source data size (Actually, even less than that!)
- The utility needs administrative privilegese
Now, let’s see how easy it is to create an automated task that initiates a System Image backup of the c: drive and saves it to another drive :) Assuming your system volume or drive is the c: and your destination drive is f: (where f: can be a second hard drive or a network share). Save the following text in a file with an extension .bat Ex: SystemSnapshot.bat
wbadmin start backup -backuptarget:e: -include:c: -allCritical -quiet
This wbadmin utility will start an image backup of your c: drive and system/boot volumes if not specified while it saves it to the f: drive.
As with any script, you can then create a schedule job using SCHTASKS ( Windows Task Scheduler command) as follows:
SCHTASKS /Create /SC weekly /D sun /TN “Imagebkup” /TR c:\scripts\SystemSnapshot.bat /ST 22:00 /IT
where the task scheduler will run the Image backup script every Sunday on weekly basis at 22:00 hours. Assuming the user is logged on and have administrative rights! However, I do recommend to use the native Windows 7 Task Scheduler Utility to set a schedule as this utility is much improved in this new OS :) Check for errors if any in the history tab of your scheduled task. An error return code of O means ok!

A folder structure is created on the destination drive together with a number of files. The most important file is the .vhd one where in Windows 7 Enterprise and Ultimate editions, you can restore all your data and applications. How to mount this image and restore your computer will be explained in a future article :)
Tags: automated, backup, image, snapshot, system, Windows 7
Posted in FAQ, Windows 7
» No Comments
October 12th, 2009
email notification
The native backup utility found on Windows servers is one cool application that has saved many SMBs real cash! Apart from fulfilling its main functionality, it is found to be very reliable and effective. Problems arise when extra features are required such as, backing up to external storage devices and/or utilizing advanced backup features! One useful feature that is standard in purchasable applications is email notification of backup jobs. The script below gives you that functionality!!!! It’s free and simple to implement!!!!
The implementation steps of the script are as follows:
- Create a backup job using Windows backup – Start/All Programs/Accessories/System Tools/Backup and set a job schedule
- Open the window Scheduled Tasks – Start/Control Panel/Scheduled Tasks and find the newly created scheduled job.
- From the properties window of this job copy the highlighted text from the Run text field
- Copy this text in a new batch file called ‘mybackup.bat’ (any name you like without quotes)
- Take a note of the batch file location and enter the full path in the Run text field of step 3 ex: c:\documents\mybackup.bat
- Close the properties window by clicking OK and enter an admin password if prompted
- Add the sample script shown below in the batch file after the text entered in step 4
- Edit the script text to reflect your email & path settings
Sample script
Copied text from step 3 goes here
@echo off
set Sender=”source email addess”
set Receiver=”your email address”
set Host=”IP address of source email server”
set Subject=”Backup name/title”
set logdir=”%USERPROFILE%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data”
REM ex – C:\Documents and Settings\administrator\ for %USERPROFILE%
set result=”%temp%\latestlog.txt”
pushd %logdir%
for /f “tokens=1 delims=” %%I in (‘dir /B /O-D’) do (
if “%%~xI”==”.log” (
type “%%~fI” > %result%
goto :end
)
)
:end
popd
c:\windows\system32\blat.exe %result% -f %Sender% -to %Receiver% -server %Host% -subject %Subject%
del /q /f “%result%”

explanation
Explanation of the sample script:
pushd
==> stores the current directory for use by the POPD command, then change to the specified directory
for /f “tokens=1 delims=” %%I in (‘dir /B /O-D’) do
=> parse each line of the directory listing (log files) and get the name of each file one by one
dir /B /O-D ==> remove heading info from directory list, and list files by date in reverse order
until
if “%%~xI”==”.log”
==>if the current file (its extension only) is .log
then
type “%%~fI” > %result%
==> then copy the contents of the current log file to the variable file latestlog.txt
c:\windows\system32\blat.exe ==> Blat is a Win32 command line utility that sends eMail using SMTP – http://www.blat.net/?docs/credits.html
Tags: automated, batch, data, email, notification, script, servers, shell, windows
Posted in Scripts, Windows Servers
» No Comments