Source control software is a wonderful thing. There is nothing like the warm fuzzy you get when you know that the last few hours of work will not be lost by a disk failure. Worse is the feeling in the pit of your stomach when the loss of work is self-inflicted (such as a save of bad over good). If your organization has the infrastructure in place (and the licensing dollars) Microsoft’s Team Foundation is a great choice. Another great tool is the Subversion (free) paired with Tortoise (free). If you would like to integrate your Visual Studio toolset with the subversion, another great product is Visual SVN.
Another down and dirty trick I use is to leverage cloud based storage AND a compression tool such as WinZip or WinRAR AND a simple batch file.
Here is how it works:
- Pick your favorite cloud storage – SkyDrive, DropBox, etc. Link a local folder to your cloud storage.
- Create a batch file that will launch the compression tool. The trick here is to use the command line switches to select the source files/folders to be archived, compression level, password and the target compressed file name location. The target folder should be the folder linked to the cloud storage.
Once set up, it’s simply a matter of launching the batch file to push a copy of your files to another location. The script I use appends a date/time stamp to each compression file so that I get a different file each time I use the batch. I have included a copy of the batch file used in this demo at the end of this post.
Here is what the process looks like:
Launch batch file:
File is created in the local drive and then synced with Sky Drive.
File has been synced:
Another file is created and synced each time you launch the batch file.
And here is the batch file I used.
rem Timestamp Generator
rem Parse the date (e.g., Fri 02/08/2008)
rem Parse the time (e.g., 11:17:13.49)
if %cur_hh% lss 10 (set cur_hh=0%time:~1,1%)
rem Set the timestamp format
rem Do something with it
rem echo Timestamp: %timestamp%
WinRAR.exe a -s -r -m5 "C:\Users\clove\SkyDrive\Professional\Version 1.1 ETL Documentation_"%cur_yyyy%%cur_mm%%cur_dd%-%cur_hh%%cur_nn%%".rar" "Version 1.1\Documentation\ETL\*.*"
I have used this in many cases and still get the warm fuzzy of knowing I have yet another safety net!