I’ve used some version control system such as SVN, and different backup software but all of them have one problem: these complex systems might require quite a lot of work to set up, and it’s quite likely that you’d need technical guidance to get them to work (well, I suppose unless you happen to be an unix geek). That’s why I wanted to try something different. Something simpler that does the job.
The simple version control system
During the last weekend I looked into setting up a very simple backup / version control system, and it took me like 10 minutes to find the necessary information and set everything up. It isn’t the most optimized system to back up stuff, but at least it’s extremely simple and it does what’s it supposed to do: it backs up data and creates versions.
I used the information provided by the LifeHacker simple version control and did some modifications to make it work for me.
Step-by-step guide for setting up a version control system
(I’m using Dead Wake game example here)
- First I created a folder “G:\Dead Wake\versioncontrol” (it’s on my second hard drive)
- Then I created a “versioncontrol.bat” file and put the following code inside it (this all should be in one line):
xcopy “D:\Dead Wake\development” “G:\Dead Wake\versioncontrol\%DATE%” /V /I /S /Y
(This copies my development folder files under the versioncontrol folder, and creates a ‘date’ folder there. Notice that I use the /Y to overwrite files automatically: since I launch this backup script several times a day, but want to store only the latest version for one day, I have made it to overwrite possible files)
- Last but not least, I used the Vista’s Task Scheduler to create a “Dead Wake version control” task: it will launch “versioncontrol.bat” several times a day.
I created 3 triggers and set up it to launch version control “Daily at 10 o’clock”, “Daily at 14 o’clock”, “Daily at 18 o’clock”. (LifeHacker provides information on how to set up scheduled tasks)
And that’s it.
Now the system will automatically backup the project folder three times a day and copy it under the version control folder. It also puts a date, so I can easily see on what date the version was created. If I want to manually launch the backup process, I can simply double click the “versioncontrol.bat” file.
I realize that this isn’t as sophisticated nor optimized system. For example, it would copy only modified files (if you want to do that, then check out “xcopy /?”, there’s help information for that too), but to my needs this is good enough. The files aren’t compressed (zipped), but since I have only like 70 megs of data (and a big harddrive), it’s not a big deal.
On a good side: you don’t need much expertise to set this up, and it’s very quick to run (of course depends how many megs you have) – and you can launch old versionsvery easily (since you don’t need to unzip anything) if needed.
Simplicity & easy of use in backing up data were my goals, and if you want to do something more sophisticated & optimized, then you gotta look from somewhere else.
If you don’t want a daily data, you can also use something like: (in the “versioncontrol.bat”)
xcopy “D:\Somestuff\” “G:\Somestuff Backup” /V /I /S /Y
This would copy everything under “D:\Somestuff\” folder to “G:\Somestuff Backup”. Notice, it wouldn’t create “date” folder, so it would be merely a one-time backup of your existing data. This can be useful for bigger amount of data, but this system would benefit from “copy only changed files” type of solution.
This way, the ‘mirror’ wouldn’t become too big. (Imagine if you copy 100 gigs of stuff, just to notice couple of days later that your harddrive got filled since there was so much data).
Anyway, this can be a good way to backup data that doesn’t change so often (unlike your current projects).
Word of warning
I think this system is as simple as it can get, but if you don’t know what you are doing, then be careful with the data folder sources and destinations, and do an alternative backup of your product files first (zip everything for example). You don’t want to overwrite your original stuff. Make some test folder backup first to see it actually works. I won’t be taking blame if you manage to overwrite your project files when setting up this backup system.
It shouldn’t happen, but I just want to make sure we know what we are doing here.
Thanks to LifeHacker.com for the helpful tips.
Update: Tip from Toni for compressing files:
I did make something similar but I added a command-line compressor because them files tend to add up fairly quickly. I used 7-Zip cmdline version.
Here’s instructions on how to get 7-Zip command line version working