|
|

Automating Backups using Scripts In the Making your First Backup section, I showed you how to backup your system by going through a series of steps that ultimately created a backup image of your operating system. Given that you should backup your system regularly, going through that many steps on a frequent basis begins to be a real chore. One of the biggest challenges people face is forgetting to backup their PCs. No matter how easy the backup software is, unless the process is automated and scheduled in some way, most people will forget to backup their systems, putting their data at risk. Fortunately, DriveImage XML makes it easy to automate and schedule backups. In this section, I will walk you through how to create a backup script which, when used with scheduling software (such as Windows Task Scheduler), greatly offloads the work you had to do in the Making your First Backup section. After you complete this section you will have a working backup script. Once the script is created click Scheduling the Backup Process on the menu for detailed a step by step guide on how to schedule the running of the backup script. |
(1) |
(2) |
Click Start -> Run In the Open dialog box, type CMD and click OK |
In the Command Window type cd\Scripts and press Enter. Once you are in the c:\Script directory, type notepad backup.bat and press Enter |
This will launch Windows Notepad and ask you if you wish to create backup.bat. Click Yes, at which point an empty notepad screen appears. |
Enter the following line of code into your script, which will be the bases of your backup process. Here is the code : |
"C:\Program Files\Runtime Software\DriveImage XML\dixml.exe" /bc /te:\drive_c /r- /s- /c /v |
Let me explain what this code means :) "C:\Program Files\Runtime Software\DriveImage XML\dixml.exe" Is simply the location of the main executable for DriveImage XML (this is the default location). Please note that you need to ensure the path and executable are within double quotes. You will see a double quote at the start of the line and a double quote at the end of the line. /bc The letter after the /b (in this case the letter c) is the drive letter you want to backup /te:\drive_c The drive letter and path after the /t (in this case e:\) is the location where you wish to store your backup image. The drive_c is the file name the image will use when DriveImage XML creates a backup image /r- This tells DriveImage XML not to use Raw mode when backing up /s- This tells DriveImage XML not to use Splitting mode when backing up /c This tells DriveImage XML to use compressing when backing up /v This tells DriveImage XML to try Volume Shadow Services first when backing up Once the code is typed into notepad (please double check all typing and spacing), save the file by clicking File, and then selecting Save. Once the file is saved, you may click the 'X' button in the upper right hand corner to close Windows Notepad. |
(3) |
(4) |
Type dir and press Enter. You should see your backup.bat file located in the c:\Scripts directory. Now let's try and run it manually to make sure you typed in all the code properly. Type backup and press Enter |
Testing the Backup Script |
If all when well, DriveImage XML will launch and prompt you to interrupt the backup process if you wish to abort it, please do nothing. |
After a few seconds, DriveImage XML gives you one last chance to abort the backup please do nothing |
The backup will begin (and act just like it did when you manually started a backup previously) |
Once the backup is complete, you will again see two dialog boxes popup informing you that the backup is complete. Leave them time out, and when they disappear, you will return back to the command window from which you originally launched the backup.bat script. |
To confirm that the backup actually wrote something to Drive E: simply type dir e:\ and take note of the output. You should see two files named Drive_C.dat and Drive_C.xml. If you see both of these files with a current date stamp, the backup was successful. Type exit to close the command window. |
(5) |
(6) |
(7) |
(8) |
(9) |
(10) |
Congratulations, you have successfully created your first backup script! |
Copyright by darkchip.com |