Cloud Folder Backup: A Rackspace Cloud Files Experiment

Recently I needed to put in place a temporary (and simple) backup solution on a remote server. I just needed to ensure that a single folder on the machine got backed up to an external location on a daily basis.

I’d read about Rackspace’s new[-ish] Cloud Files service (previously Mosso) which is similar to Amazon S3 and comes with a RESTful API. Rackspace has been developing a bunch of language specific bindings over the top of this API, making it easier for developers to develop against it with their preferred language.

The source code for each binding is open source and the C# .Net binding is hosted on GitHub – so I thought I’d set about writing something über simple to accomplish the task and use Cloud Files as the backing store in order to check it out.

The result is Cloud Folder Backup, a little utility app driven simply by its configuration.  It uses DotNetZip Library to create an in-memory zip of the source folder you want to backup and then uses the Rackspace C# .Net binding to put the stream into a predefined container within Cloud Files.

I intended to use Windows Task Scheduler to run it daily, so wrote a simple console app that by default provides a little feedback, but can be run in silent mode (for use with Windows Task Scheduler et al).

Basic logging is provided by log4net, so you can keep an eye on how often it’s run and/or any exceptions that may have been thrown.

Specs are written in MSpec and supported by Rhino.Mocks

It’s a painfully simple little app – but does exactly what I need it to do. All the code and documentation is up on GitHub, if you want to take a look/use it: http://github.com/redbadger/CloudFolderBackup

dwynne