Four ways to automatically backup your hard drive
There are many pieces of software that are available to help you backup your hard drive. However in my opinion, the simplest and most customizable way of backing up your hard drive is to do so with a homemade script. I will show you how to create a very simple script that will backup your entire hard drive on the first run. With each successive run of the script, it will only backup the files that have been modified. I will show you how to set it up so that you can backup your hard drive automatically without interrupting your work flow and without hampering any productivity. No longer will you unnecessarily lose any files again! I will show you how to do the following:
- 1. Backup your hard drive on startup without using any extra software
- 2. Backup your hard drive at scheduled intervals using AutomaticDailyBackup.bat
- 3. Backup your hard drive at scheduled intervals using Windows Task Scheduler
- 4. With the use of Xecutor, backup only the files you’ve changed on shutdown
This tutorial is demonstrated using Windows XP, however it will extend equally well into Windows Vista.
The first step is to create the backup script. The script is very short and very easy to create. First, open Notepad (Start >> All Programs >> Accessories >> Notepad) and copy and paste the following text into your Notepad file:
cd c:\
xcopy c: e:\AutomaticDailyBackup /s /e /t /h /D
Make sure that you copy the text onto two separate lines exactly as it is shown above. Also, please note that this script will backup your hard drive to an external location at e:\. If your external hard drive is located at another location, you will want to change the e:\ to a letter that corresponds to your specific external hard drive. Also, if you do not have a folder called “AutomaticDailyBackup” (I’m betting you won’t) in your e:\ drive you should create the folder manually.
Save your Notepad file with the name “AutomaticDailyBackup.bat” it is very important to include the “.bat” at the end of the file so Windows knows that it is a script and not just a plain-Jane text file. Additionally, please make sure you save the file to C:\. You can now close Notepad and you should have the file C:\AutomaticDailybackup.bat. This is shown below:
This script file will be used by three of the four methods of backing up your hard drive that are shown below.
1. Backup your hard drive on startup without using any extra software
This is probably the quickest and easiest way to backup your hard drive. Right-click on your AutomaticDailyBackup.bat file and select “Create Shortcut.” After you have created the shortcut, move it to Start >> All Programs >> Startup and your hard drive will get automatically backed up every time you log in. These two steps are shown below:
In order to prevent this file from interrupting your work flow when it is backing up your hard drive, right-click on the shortcut in your “Startup” folder and choose “Properties.” In the “Properties” dialog, change “Run Normal” to “Minimized” and click “OK.”
2. Backup your hard drive at scheduled intervals using AutomaticDailyBackup.bat
The second way to backup your hard drive is to schedule an automatic backup using Windows Task Scheduler. First, you need to open Task Scheduler (Start >> Control Panel >> Performance and Maintenance >> Scheduled Tasks).
Once you launch Windows Task Scheduler, click “Add Scheduled Task” and then click “Next.” On the “Click the program you want Windows to run” selection screen, click “Browse…” and choose C:\AutomaticDailyBackup.bat and click “OK”.
Choose the frequency you would like the task to run (I chose weekly) and click “Next.” Select the day and time you would like the task to run and click “Next.” Enter your password (if you have one), click “Next” and then click “Finish.” Your scheduled task is all set and it will execute itself automatically at the day and time you chose. If you would like to backup your hard drive more frequently (for example, two or three times per week) create several tasks identical to what is shown above and set them to run on different days of the week.
3. Backup your hard drive at scheduled intervals using Windows Task Scheduler
You probably noticed that Windows Task Scheduler has a backup utility built right into it. I prefer to use the AutomaticDailyBackup file to backup the hard drive because it has a finer-grained control of the backup process. However, if you prefer, simply select “Backup” (shown below) and Windows Task Scheduler will automatically control your backup.
4. Backup your hard drive on shutdown
In order to backup your hard drive on shutdown, you need to download Xecutor. Xecutor is a free download that you can download from the Xecutor homepage. Once you install Xecutor and run it for the first time, it will ask you if you want to run Xecutor on Startup — choose “Yes.”
Next, select the “Shutdown” tab and then the green plus sign. On the properties screen, navigate to C:\AutomaticDailyBackup.bat and click “OK” (don’t worry about changing any other settings). You should see the following:
Now when you shutdown Windows, Xecutor will automatically run the AutomaticDailyBackup script.
Hopefully you found at least one of the four ways to backup your hard drive useful. Coming from someone who lost everything on a hard drive without backing up, please don’t underestimate the importance of backing up your hard drive. If your hard drive crapped out right now, how much information (documents, music, pictures, videos, etc.) would you lose?




Comments
ray says on March 14th, 2007 at 11:29 am
Good tip and looks almost too easy! Has anyone tried this yet? What are the drawbacks? Does it auto overwrite the previous backup?
Shane says on March 14th, 2007 at 11:55 am
I don’t think this method will ensure that windows is actually recoverable from the second drive as it may not copy all the correct registry hives over to the external drive.
It will however make sure that ALL your files are backed up and readable by any computer as it will strictly be a copy of what you had.
I like this! Good post - just want some clarification on how to get windows boot abilities out of it.
-Shane
james says on March 14th, 2007 at 12:11 pm
Suggestion for the batch file. Look into using robocopy (from microsoft resource toolkit) instead of xCopy. It provides a lot more power and can be configured to only update changed files.
brandon says on March 14th, 2007 at 4:44 pm
If u don’t want to use the 3rd party tool xecutor, you can launch scripts at shutdown using Group Policy. Start->run->gpedit.msc
computer configuration->windows settings->scripts (startup/shutdown)
vis says on March 14th, 2007 at 8:28 pm
Actually it doesn’t work. I tried it and it only copies files in c:\ and not the whole directory hierarchy. You are missing a directory structure copy option /t.
it should be
xcopy c: e:\AutomaticDailyBackup /s /e /t /h /D
LW says on March 16th, 2007 at 12:49 pm
It doesn’t work in Vista. Vista does not include a copy of the xcopy file.
Macker says on March 17th, 2007 at 2:31 am
I’ve tried this but it aborts with the error “Unable to create directory” for the first directory in my drive.
Benjamin says on March 18th, 2007 at 11:23 am
I’m liking mozy.com - free backup for the first 2 gigs of your stuff. Seems to be working great so far! (and I hope they are making $ somehow.)
Einar says on March 22nd, 2007 at 9:53 am
Hey, fantastic, I tried this and it works well. thanks
CJ says on August 31st, 2007 at 4:02 am
i’m using too MOzy, free 2,2 giga of backup if u use this link to register. https://mozy.com/?code=GREZ68
Jeff says on March 9th, 2008 at 8:00 pm
For secure backup you need the right hardware and software. Iomega’s eGo was one of TIME magazine’s “Top 10 Gadgets” of 2007 and comes with version of EMC Retrospect software for automatic backups.
http://www.backtrackreviews.co.....dd-review/
Mark Ward says on March 13th, 2008 at 1:37 pm
Will the “Four ways to automatically backup your hard drive” work for Windows 2000 as well?
Thanks for an e-mail reply..
Mark
ken rushton (MusicScienceGuy) says on July 25th, 2008 at 2:01 am
I suggest one put a pause after the xcopy to see if the copy runs into problems.
- with the /t option it only created the directories,
-with the /h option it included hidden files that gave sharing violations and quickly stopped
-without the /h option it run for a while
Behaelter says on August 16th, 2008 at 3:08 pm
I believe the the /t switch sets the command to copy ONLY the directory structure (FOLDERS only) and nothing else. I don’t think that /t should be in there if you also want your FILES to be backed up as well, which I think is the purpose of the script, right? /s = subdirectory, e/ = empty subdirectory, /t = subdirectory tree ONLY h/ = hidden & system attributes set, /d [w/o parameters] = overwrite older date stamps. I just tried this to check if I stand corrected, but my new directory shows ONLY the directory structure (folders). It is just a bunch of empty directories. If the initial backup of your system happens REALLY fast, chances are your data wasn’t copied over and catastrophic damage to your drive C (or whatever drive you’re taking the time to back up) will wipe it out (both figuratively and literally) May I suggest to the author linked from this page a script (batch file) for verification that data has been backed up? A false sense of security can be more damaging than complacent redundancy. I’ll go ahead and introduce a simple approach; A simple way would be to pipe it to a text file and see exactly what is actually being copied over. For instance, if you want to see a report of all the files being copied over, I would use ” > NameOfNewTextReport.txt” at the end of the xcopy command you are going to run. It will not xcopy the files, but only tell you which files WOULD BE moved when the command is sent without the pipe. So to see which files will be backed up, you can try something like this:
xcopy c: e:\AutomaticDailyBackup /s /e /t /h /D > c:\AutomaticDailyBackup_testRPT.txt
So what you have is a text file in the root of C:\ called AutomaticDailyBackup_testRPT.txt that lists all of the files that will be moved when the command is used without the pipe. You can also use both in your batch file:
@echo off
xcopy c: e:\AutomaticDailyBackup /s /e /t /h /D > c:\AutomaticDailyBackup_testRPT.txt
xcopy c: e:\AutomaticDailyBackup /s /e /t /h /D
Here you see your report being generated, and then it goes ahead and does it. You can also set attributes to either replace or append to your log file (text file) if you want to keep a record of its changes. Oh, the @echo off statement just represses the commands in the cmd window declared in the script (batch file). Cheers.
Behaelter says on August 16th, 2008 at 3:14 pm
Also, I used the example exactly from the original, and so I left the /t in there for that reason.
Behaelter says on August 16th, 2008 at 3:20 pm
Also, the pipe command above have wrapped within the text window. The fileneame AFTER the pipe (>) is on the same line.