Monday, August 16, 2010

Setting up SVN for Home backup

Adding Subversion SVN source control to your home server is a great hack for backing up your important files. I was using SyncBack by BrightSparks for my back ups and still do for some files, it’s very easy to use and has a lot of useful configuration options. Sometime you need an older version of a file and source control is extremely usefully in getting older versions. I wanted the ability to easily get older versions of Picture and video files and work on editing file without worrying about changing and deleting content.

Heres my quick start guide for setting up SVN for Home backup

1.       Install Subversion, I installed the CollabNet version with the default options and had no problems but you may to scan this web site first and pick the one that fits you environment.
2.       Create the Repository, Create at least one repo for backing up your files
a.       Command:> svnadmin create c:\svn_repository\MyFiles
b.      I create separate repo’s for each class of files I want backups of. Like Photo, Documents, Source, Music and Video. Photo repo for all my digital photographs and a Documents repo for all my Office files and you get the rest.
3.       Next you want Verify you can connect to your repository
a.       Command:> svn list svn://localhost/MyFiles
4.       Other this you might want to do
a.       Change the password
b.      I recommend using TortoiseSVN it much easier than using the command line utill.

Friday, August 13, 2010

Get the content of a web page and write to file.

There’s been a couple times I wanted to keep copies of web sites to parse the data at a later date. When you don’t want to interact with the page and just need to a simple response I use the request/response methods.  This is one of the few times I don’t use html DOM automation.

This script creates a Microsoft.XmlHttp object for communicating with the web server, it does a simple get request on the Url. The same code could be used to pull down any type of content (jpg, mp3, etc..) given you have the Url.

URL = ""
' Create the HTTP object
Set xmlhttp = CreateObject("Microsoft.XmlHttp")

' Open connection "GET",  URL , false

' Send the request synchronously
xmlhttp.send ""

' Write the response to a file
Set objFileSys = CreateObject("Scripting.FileSystemObject")
Set file= objFileSys.OpenTextFile("Google.htm", 8, True, 0)