There comes a time that after messing with computers for so long, and learning about their intracacies, you learn that there is some stuff you REALLY don’t need to be paying for. Data backup software is one of those omittable things in my opinion. Why pay in the upwards of $39.00 for software when a simple script can easily take care of what you need?
Read on to find out how to create your own data backup script!
After reading this, you may think, “Data backup software should probably be illegal… or at least be 3 bucks.” To be technical, all data backup software does, is use simple commands and variables to take in your input for what you want backed up and then copy it to where it belongs.
Obviously there are super pro utilities such Acronis, which will make an entire image of your HDD, which is infinitely valuable. Here, we are just going to do simple directory copying. In fact, windows has a command builtin to the shell to accomplish this.
Commands we will need to know:
ROBOCOPY – That’s right, the only cool name for a command ever. Robocopy’s syntax looks like this…
C:\User>robocopy source destination /MIR
C:\User>robocopy c:\mylife d:\otherlife /MIR
Notice the /MIR on the end as an argument, we are telling robocopy that we would like to make an exact mirror of the directory and everything in it. Don’t forget, you will need the absolute file path in order for this to work properly.
So let’s make a simple script that will copy one directory, from one hard drive to another. Just like last time, open up a notepad and just type what you want to happen. In this case, I would like my wii configuration and save data to be transferred from one folder to another. The script will look like:
robocopy c:\wii “d:\wii backup” /MIR
That’s it. Save it and run it. My copy was 5 megs, took a blink of an eye, literally! Robocopy will also create the directory for you, and do automatic overriding. If you wish to see the statistics of the robocopy operation, just add “pause” below the robocopy command in your script.
Also notice that for the second parameter “d:\wii backup”, I added quotation marks. That’s because the directory contains a space in it. In the command line world, any spaces without quotation marks in proper places is seen as an argument. If we did d:\wii backup it would probably error telling you something about backup command not being found.
Now you can easily create your own backup scripts. Flood the script will all kinds of copy operations and let robocopy do all the work. If you need it to be automated, you can just add it to the task scheduler built into the Windows operating system. For Windows Vista users, just type task into the hotsearch in the start bar.
For you XP users “To open Scheduled Tasks, click Start, click All Programs, point to Accessories, point to System Tools, and then click Scheduled Tasks.” – microsoft.com
That’s it for this article on simple scripting. $39.00 software? I think I’ll just type a one line script and let robocopy handle it. Next time I’ll try to introduce wildcards and basic directory navigation.