Think of the unhappiest times with your computer.. What happened during those times? What would cause your face to freeze and your jaw to drop? In my experience it has almost always been because data was lost. It’s normally the realisation that everything you had was gone – when you stare blankly at the computer for 5 minutes dumb-struck. Maybe you went into a folder in your My Documents that was, until yesterday, full of those really important files you were doing for work. Or maybe you went to power on your PC and you had one of those horrible error messages from Windows, that essentially means “your system has gone bye-bye.”
After the realisation sinks in, you also try to think if you have any backups – if you’re smart you will of course followed this simple tutorial to create a daily backup and feel comfortable that you can get to all of your old files. If you’re not then the sinking feeling will continue and you will have some explaining to do to the boss/friend/other half.
This tutorial is very simplistic – I use the method on my work’s Windows PC, and it’s perfect for what I need. If you need more power over your backups, perhaps with differential, or encryption flavours, I would encourage you to use the built-in backup program for Windows (Start->Run->ntbackup) or download one of the many open-source alternatives.
How To Create A Simple Backup Batch File In Windows:
Firstly you will need to get a hold of an invaluable (and free) utility from Microsoft called “Robocopy”. It’s funny because you think of RoboCop when you use it. It comes with the Server 2003 Resource Kit, so you probably won’t have a copy on your system. There are lots of other useful almost linux-like command line tools that come as part of the whole package – and no – don’t worry, you don’t need to have Windows Server 2003 to install it – it will be fine on XP or Vista.
Once you’ve downloaded and installed the kit, we need to create the batch file containing your backup commands. Firstly, double check that file extensions are visible, by going to the Control Panel, double clicking Folder Options, and un-checking the “Hide extensions for known file types” box in the View Tab. Next, right-click a blank space in your (My) Documents folder and select “New->Text Document”. Windows will create a file called “New Text Document.txt” – rename this to “backup.bat” and we’re ready to edit it..
Now comes the part where you need to work out what you want to backup and where you want to back it up to. You have a few options – To the same hard drive, but a different folder; to another hard drive on your computer; an external hard drive; or a hard drive on the network. The more detached you can make your backup the better. If your current hard drive goes down, and you had decided to backup to the same hard drive, but in a different folder, your backup would be about as useful as a chocolate teapot. I personally backup to another PC, that is in the same room – I figure this is good enough – especially as I burn off a DVD with all of my documents anyway every month or so. Have a think about it and work out the best place to store your backup.
With the pathnames at hand (source and destination for your backup) we need to edit the batch file. Right click the backup.bat in your documents folder and select edit. Fill it with one of more lines of the robocopy command below (depending on how many things you want to backup) – I’ll explain what the switches are afterwards.
robocopy /e /zb /copyall /purge /xo /r:3 /w:5 "C:\Documents and Settings\Paul\My Documents" "\\ServerName\Backup\My Documents"
Broken down: The two strings in quotes at the end are the source directory, followed by the destination directory. Robocopy will copy all files and folders inside the source directory, including empty folders, all the way down that particular directory tree. It will retry locked files 3 times, waiting 5 seconds between each retry. It will copy all security settings for the files (If you are not copying over a domain, say you’re on your home PC, I would suggest replacing the /COPYALL for /COPY:DAT) and it will only copy new files (which will be everything to start with – subsequent runs of the command will copy only files that have changed since.) The /purge switch is optional, and has a big impact on your backup. /purge will remove anything in the backup, that has been deleted in the source folder. I’m very careful with what I delete, so I’m comfortable using it. You may not be so comfortable, or may want the extra security of knowing even the stuff you didn’t want will still be kept in the backup.
And that’s it. The file is ready to be run. Simply double click from your documents folder to set it into action.
To make it a daily backup, that’s automatic, you can setup a schedule very simply with the one built into windows. Go to Start->Accessories->System Tools->Scheduler and follow the simple to use wizard, making sure the command to run is your newly created batch file.
Vista Update:
For those of you using Vista, with UAC turned on, you will need to run the batch file with administrator privileges. There are two methods – the easiest is to right-click the batch file, and select “Run as Administrator”. The more difficult way, is to create a shortcut to the batch file, right click that shortcut, click the “Advanced” button on the shortcut tab, and select “Run as Administrator” – just remember to execute your backup with the shortcut, not the original batch file. I hope this clears things up for some of you.
free commander – windows explorer alternative... share an iTunes library with different users of the same computer... Hard disc involved in blackmail attempt – how do you protect yourself?... freeware defrag utility "defraggler"... migrate from windows to kubuntu...
-
jason
-
Paul Godden



