What backup plan do you use for your computer? Do you even have one? Could all of your files be easily replaced?
It surprises me how many people still don’t back up their data. Eventually your hard drive will break. You may get a new computer before this happens but what if there were a flood or a fire?
My hard drive died last January. Actually, it happened on of the worst days of my life but that is another story and is probably not appropriate for this blog. Fortunately, I had started consistently backing up 4 to 6 months before this happened. Yes, I had to buy a new hard drive, install it, install windows, and reinstall my programs but I still had my photos, music, templates, saved games, and application data, so other than the expense and the loss of a couple of hours it wasn’t that big of a deal. It was an aggravating experience but not a traumatic one.
I don’t currently use an online service, such as Mozy, to back up my data. I find these services are slow to upload and sync and I am a bit paranoid about the security of it. Instead I use scheduled backups with two external hard drives.
The first hard drive is backed up once per day and is kept at home on my desk. The second is backed up weekly on the weekend and is stored at work during the week. This way I have a current backup in two locations and it is unlikely that my house and my cubicle will burn down at the exact same time. Of course, if something catastrophic were to happen in Philadelphia, they would both be destroyed but I think I would have bigger problems at the point, like survival.
I backup My Documents and my Application Data. Almost everything important is stored in My Documents and Application Data contains configuration settings and profiles for programs like Firefox so if I have to reinstall a program I can quickly have all of my preferences back. Fortunately, most saved games are now stored in My Documents/My Games as well rather than in the Program File directory for the game Games that aren’t stored in My Documents don’t get backed up as frequently but if there is one in which I have invested a lot of time, I will make a point to copy the saved games.
In Windows, I use batch files and the Scheduled Tasks utility to automate the backups.
A batch file can be created with any text editor. Just make sure to save it with the .bat file extension.
The backup scripts look like the following:
@echo off
:: variables
set drive=I:\backup2
set backupcmd=xcopy /s /c /d /e /h /i /r /yecho ### Backing up My Documents…
%backupcmd% “%USERPROFILE%\My Documents” “%drive%\My Documents”echo ### Backing up Application Data…
%backupcmd% “%USERPROFILE%\Application Data” “%drive%\Application Data”echo Backup Complete!
@pause
Note: If you remove @pause the backup window will close when the task is complete. I like to leave @pause on and manually close the window so I know that the process occurred.
These should work for you as long as you use the correct paths to you own files. The “set drive” is where you are backing up the files and the two “%USERPROFILE%\Application Data” “%drive%\Application Data” sections are the directories being backed up.
Then automate the backup by setting up a scheduled task.
Go to Control Panel > Scheduled Tasks > Add Scheduled Task and the Scheduled Task Wizard will appear. Select Next. The Scheduled Task Wizard will list the programs that are installed but you will want to browse to where you saved the .bat file. You will then be prompted to select the frequency and the day and time that you want the scheduled task to run. You will then need to set the login that you use for your computer. When I first started backing up this way my backups weren’t running and I couldn’t figure out why. I learned that you have to have a login with a username and password. I didn’t have a password set because I am the only one that uses the computer. It is better now that I do for security reasons.
hard drive photo credit: dmuth
Sommer-Green&Clean Mom says
Okay don’t scream but what is a batch file? How do I find it and yes, I don’t back up. Well, I tried doing it to my laptop to my hard drive and not on disks and it said it was full? It was new. I did something wrong.
Kim Woodbridge says
Hi Sommer,
Why would I scream?
Basically a batch file is a text file that contains a series of commands and is used in DOS and Windows. It isn’t something that you find on your computer is a file you create, like a Word document.
http://en.wikipedia.org/wiki/Batch_file
My example backup file can be copied and pasted into Notepad and then saved as backup.bat rather than backup.txt . It should work on any windows machine as long as the paths are changed (where you are backing up to and where you are backing up from).
Honestly, I don’t understand everything in the batch file that I use – I read other articles, looked at what others created and found what worked.
I like that once I got the script to work with the scheduled tasks function that I didn’t have to think about it anymore – my files are simply backed up on a regular basis. And I am really lucky that I started doing this before my hard drive died last winter.
This is just one way of backing up and is what works for me – it might not be the best solution for everyone.
Let me know if you want to discuss this more – I’m happy to help.
LGR says
Good post! I am paranoid about losing data and use a similar method to backup my data. I don’t use a external drive though I use another computer that is networked and one of its tasks is to keep backups. I also use an online service for offsite backups as well. Mozy actually. I am really happy with it. It can be slow to upload all your data at first but once it is uploaded it really does not take much to keep it all synced. Not long ago I had a hard drive die and between my local backups and Mozy I was able to recover 99.9% of the work I was working on. There was only one file that had not been backed up between Mozy and my local copy. That is one of the things I like about Mozy it can backup almost continuously so if you have a crash between local backups you can often recover files that you might have lost otherwise. Not to mention if I had a fire or flood here in my house I would be sunk if all my data was lost, or all of our family photos. Mozy keeps them offsite and I don’t have to think about doing it. As you can tell I am a pretty happy Mozy customer. I am glad I use it.
Scam says
I used to be someone who never backed up, thinking that data loss was something that happened to other people.
Back in January, however, there was a problem with my web host – many of their clients, including myself, lost their mysql databases. Worse still, the couple of backups they kept became corrupted too.
I always kept one backup of that database on my hard drive, the latest copy which was emailed to me. As soon as I received it I would delete the previous copy.
Guess what… the most recent copy I had also contained that same corruption, meaning that I pretty well lost an entire site that I had been working on for over a year, a site that was getting thousands of visitors a day and a quarter of a million page views per month!
Now, things are different. I have 4 hard drives – 2 in RAID 0 for speed (games) and 2 in RAID 1 for security (data).
I backup my database 3 times per day on to an external hard drive, once per week I copy the same onto dvd and once a month I copy the most esssential stuff onto a usb pen drive which I then leave round a friend’s house to ensure I have off-site backups too.
If you don’t backup, DO IT NOW, because sooner or later, you WILL regret it otherwise.
Kim Woodbridge says
@LGR – Thanks for stopping by :-)
To be perfectly honest, I have not tried Mozy. I have only heard that it can take a long time to back up your data. How much are you backing up? I have 50GB of just music. They do have a great price though.
Kim Woodbridge says
@Scam
That is terrible – I am so sorry that happened to you. Unfortunately, it seems that backing up is one of those situations where you don’t do it until you learn the hard way. I was VERY lucky that I started my backup system shortly before my hard drive died. (I think I’ve now had every computer component break except for a sound card and power supply).
I think a lot of people assume that their webhost has backups and that they don’t have to worry about their sites. I haven’t experienced anything like what you did but have had a host who had a problem and I lost a couple days of posts on my elephant site.
Do you also backup the rest of the site files? Like the theme, images and plugins? If so, have you found a good automated way to do this or do you do it manually?
Scam says
I have a backup of the theme on dvd, and another on a usb drive. These are the originals so if I had to use them then I’d need to make a few tweaks and modifications in order to get the site exactly as it is now.
Again, plugins are all saved in the same place – I don’t tend to add or remove those very often.
Images I use a lot of so I back them up every weekend. In fact I have all the ones I’ve used since December 06. It’s just a shame I don’t have all the posts they were included in, especially as my 8 most popular ones were lost :(
Scams last blog post – Has Liz Taylor Been Murdered?
Wesley says
I did everything you said but it didn’t work for some reason.
Here’s what happened:
http://i35.tinypic.com/vem71k.jpg
Here’s my bat file:
@echo off
:: variables
set drive=L:\desktopbackup [my backup is drive L, and I want to divide my backups into desktopbackup and laptopbackup]
set backupcmd=xcopy /c /d /e [to back up my c, d, and e drives]
echo ### Backing up My Documents…
%backupcmd% “%USERPROFILE%\My Documents” “%drive%\My Documents”
echo ### Backing up Application Data…
%backupcmd% “%USERPROFILE%\Application Data” “%drive%\Application Data”
echo Backup Complete!
@pause
Where did I go wrong?
Please help me.
Wesley´s last blog post – if.e.v.v.v.v.dx.six
Kim Woodbridge says
Hi Wesley,
This line
set backupcmd=xcopy /c /d /e [to back up my c, d, and e drives]
has to be exactly the same as the one in the tutorial
set backupcmd=xcopy /s /c /d /e /h /i /r /y
/s /c etc aren’t drives they are backup commands.
Wesley says
Oh, okay. So how does it know which drives to back up?
Wesley´s last blog post – if.e.v.v.v.v.dx.six
Wesley says
Grrrr! It did the same thing again.
Wesley´s last blog post – if.e.v.v.v.v.dx.six
Kim Woodbridge says
Wesley – I only back up my Application Data folder and my My Documents folder – I make sure that everything I need to save is in those two places. Everything else can easily be replaced.
For me
%USERPROFILE% = C:\Documents and Settings\Kim
If you want to back up specific locations I believe you would want to set the path. Instead of using %USERPROFILE% you would use E:\backup\ or whatever the directory is.
If you did that you would also want to change these lines
echo ### Backing up My Documents…
to whatever you are backing up – example
echo ###Backing up Ebackups
Kim Woodbridge says
Sometimes extra characters get added when text is copied and pasted. I frequently have to retype some of it. If you keep having trouble you might want to email me directly and attach the .bat file (you will need to zip it up for the email program to accept it).
Carla says
OK – I’m really going to have to comb through this carefully! I use a Mac and need to figure out how to translate to that type of platform…
Carla´s last blog post – Emperor “Clean Coal” has no clothes
Wesley says
–> http://i34.tinypic.com/1zoenwo.jpg :*(
.
//.xx
.
Here’s my current bat file:
@echo off
:: variables
set drive=L:\desktopbackup
set backupcmd=xcopy /s /c /d /e /h /i /r /y
echo ### Backing up C Drive
%backupcmd% “C:\”
echo ### Backing up D Drive
%backupcmd% “D:\”
echo ### Backing up E Drive
%backupcmd% “E:\”
echo Backup Complete!
@pause
.
.
.
I thought I finally had it. What’s wrong with it now?
Wesley´s last blog post – if.e.v.v.v.v.dx.six
Kim Woodbridge says
@Carla – This article is for backing up your hard drive, not WordPress. I think with a MAC it’s integrated.
@Wesley – I think we’re almost there. You need to tell each %backupcmd% “C:\”
where to go
%backupcmd% “C:\” “%drive%\cstuff
etc
Also is your backup drive big enough to back up the contents of all three drives? You shouldn’t need to back up the entire hard drive, just parts of it.
Wesley says
Okay, it did the same thing again. Current bat file:
@echo off
:: variables
set drive=L:\desktopbackup
set backupcmd=xcopy /s /c /d /e /h /i /r /y
echo ### Backing up C Drive
%backupcmd% “C:\” “L:\desktopbackup\C”
echo ### Backing up D Drive
%backupcmd% “D:\” “L:\desktopbackup\D”
echo ### Backing up E Drive
%backupcmd% “E:\” “L:\desktopbackup\E”
echo Backup Complete!
@pause
You should add “if you’re not an idiot” at the end of that post title.
My back up drive is 1TB so I think that should be plenty. Could that be the problem?
Wesley´s last blog post – Updating your blog can be a real pain when you can’t tell what you’re writing.
Kim Woodbridge says
@Wesley – Actually it took me a number of attempts to get it just right.
L:\desktopbackup\C – you’ve already defined L:desktopbackup so use
%drive%\C
Also retype all of the doublequotes – if you’ve been copying and pasting extra characters can get in there – there were some strange ones in the last screenshot.
1TB should be fine – I just don’t think it’s necessary to back up everything. Actually, it may not be able to backup certain files that are being used to do the backup.
Wesley says
Same result again.
Current bat file:
@echo off
:: variables
set drive=L:\desktopbackup
set backupcmd=xcopy /s /c /d /e /h /i /r /y
echo ### Backing up C Drive
%backupcmd% “C:\” “%drive%\desktopbackup\C”
echo ### Backing up D Drive
%backupcmd% “D:\” “%drive%\desktopbackup\D”
echo ### Backing up E Drive
%backupcmd% “E:\” “%drive%\desktopbackup\E”
echo Backup Complete!
@pause
Thank you so much for all of the help you’ve been. I just can’t imagine what I’m doing wrong.
Wesley´s last blog post – Updating your blog can be a real pain when you can’t tell what you’re writing.
Kim Woodbridge says
Try removing \desktopbackup
use
“%drive%\C”
You might also want to just do one drive at a time. Once you get that working add the others.