Back it up (redux)
Further to my post the other day about Strongspace, backups and rsync, I thought I would just write a little bit about how I have everything setup, more for my own records than anything else. If the two other people who venture onto this page would like to read along then open your books to page one, and remember to turn the page when you hear the bell.
First of all, you need to get yourself a Mac. I’m serious about that. I’ve been a PC person all along but things just work better on MacOSX. It’s true. I know it sounds a little like a reformed smoker, however, you should really give a Mac a go. Get a MacMini. They look sweet.
In order to connect to Strongspace, you need to have ssh on your computer. This comes standard with MacOSX, but you will have to download it for Windows. The best client that I have found is PuTTY. Download it (it’s free), put it in your windows folder.
The next application you need is an FTP client that supports SFTP. The best (IMHO) windows free client is FileZillla, and for MacOSX it’s Cyberduck.
Then (and this is the bit that I don’t know how to replicate on Windows) you have to create some SSH public keys. We need to do this so that we can make connections to Strongspace without having to type in a password everytime we want to back some files up. There are instructions on how to do this on the Strongspace blog. Essentially you need to create a public key and copy it up to a file called “authorized_keys” in a .ssh directory in your user directory on strongspace and then away you go. All very handy.
The next step is to write and test your rsync script. There are more options for rsync than I could ever learn, and also more functionality than I could write about, so I will just post the script I use. Basically it copies all data within my user directory, excluding directories that are listed in the “backup_excludes.txt” file and delete any files from the remote server that have been deleted from the local computer. Simple really:
#!/bin/sh rsync -e ssh -azvC --delete --exclude-from backup_excludes.txt \ /Users/userdir/ username@username.strongspace.com:/home/username/
The next step is to add a cron job to your computer. This is where the Mac part becomes pretty essential, because Windows doesn’t have cron. It does have Task Scheduler, but I haven’t been able to get that to run particularly reliably. In any case, an entry like the following will run your backup script every hour between the hours of 9AM and 10PM during the day.
01 9-22 * * * /Users/userdir/backup_documents
Now this might seem like a lot to copy up, but that’s the beauty of rsync. It only does incremental copying, so it will only copy files that have changed since the last time the script ran. Of course, if you work with video files, this might be overkill, because of the time it takes to upload the files, so you can adjust to your own needs.
rsync can also do standard weekly incremental backups, which is something I have yet to experiment with.
Like I said, this was mainly for my own records, but hopefully it will come in handy for someone.
UPDATE: While trying to help Dave Caolo it became apparent that I left one step out of the article … installing SSHKeychain. This freeware program waits on your computer for an SSH key request, intercepts that request and sends the required information, eliminating the need for you to have to type in your passphrase every time you try to backup your data, or SFTP into somewhere. It’s very handy.
Back it up
I recently signed up to Strongspace, the latest service from TextDrive, the wonderful people who host all of my RubyOnRails sites.
Strongspace is essentially an online storage service, with all sorts of added features. You can upload using SFTP, browse your files using your browser, and unlike other services, you can actually login to your account via ssh. This last part is particularly cool when combined with rsync.
rsync is a fantastic utility that performs incremental backups either on your own computer, over your network, or in the case of Strongspace, over the internet. Once you do your initial upload, you just run the script as often as you want, and it will only upload what has changed.
All in all, some very cool stuff, and when used in concert, it’s an amazingly powerful system that can ensure that you never lose anything ever again.
Now if only I can convince myself that I can afford the 30Gib plan, I can back up all of my photos as well!
One Year
So, as of yesterday, we have been parents for 1 year. And I’m sure it’s been said many times before, but wow, what a year. It’s all been pretty much fantastic, and we have a wonderful little girl.
It’s so cool to watch her grow and develop. Looking back through the photos from her monthly birthdays it’s amazing to see the development that you don’t notice on a day to day basis.
What we have noticed day to day recently is a real burst in mini milestones. In the last month she has:
<ul>
<li>Gone from waking up 3-4 times a night, to sleeping just about the whole way through,</li>
<li>Started drinking out of her cup,</li>
<li>Started eating on her own</li>
<li>Free standing</li>
</ul>
All very exciting.
We’re off to Rottnest tomorrow with Caren’s work. Should be interesting. Hopefully we can obtain healthy supplies of alcohol.
Oh, I found out today that Dee is in hospital … nothing too serious from all accounts … just some bed rest. Paul must be working her too hard.
“Get mah dinner woman!”
11 Months Old
It’s just astonishing how quickly this has happened, but our little girl is almost 1 year old! No doubt we will soon be saying “I can’t believe she’s leaving high school!” and “Wow, she’s leaving home. Sigh!”
Getting Underway with Ruby On Rails
This post originally appeared over on Spin Technologies, but I decided that it was probably more appropriate for this site. So here it is!
Almost a year ago, I started hearing about BaseCamp, a project management/organisational tool, that had been created by 37 Signals. As more information started appearing about the product and it’s development, people started talking about RubyOnRails, a new “framework” for web development. Details were relatively sketchy, documentation was around but not for the beginner and most importantly, Rails was only at 0.4 or something similar, so I had a quick peak, and then ducked for cover within the comfortable blanket I had made from ASP.Net and C#. (Oh, but I signed up for BaseCamp though!)
And then in December last year, a client that I had developed a site for, using my technology security blanket of course, came to me with an idea for a site (it eventually became World Time Capsule- a site where you can store information/documents/whatever and lock them up, for loved ones to view later). There wasn’t a lot of money for the project and so I began to think that this might be an opportune time to begin to look at RubyOnRails. I sat down and did a couple of the online tutorials that had appeared around the place (mainly blogging applications, todo lists - modelled on Tada from the ubiquitous 37 Signals!)
It quickly became clear that here was a technology that had been lovingly crafted, with amazing skill and forethought. David Heinemeier Hansson is the creator of the framework. He was initially a contractor for 37 Signals, doing work in PHP, and then when he started work on BaseCamp he decided to create a new method of developing websites. Once BaseCamp was up and running, he extracted RubyOnRails from it, did some polishing up and released it out onto the web.
It was quickly taken up by developers around the world who were getting tired of the large amounts of work that needed to be done in order to start a project, and were taken by the simplicity of the code. These developers started making suggestions and improvements, working hard to fix bugs and issues that arose, and basically working hard to create a fantastic environment. These efforts continue today, with David recently allowing Jamis Buck and Jeremy Kemper to commit changes to the official RonR source tree.
Bear in mind that all of this development is because the extra nice people at 37 Signals decided that the technology they built when creating BaseCamp would be made available to whomever wanted it, at no charge. Open Source at it’s best.
So how is Spin making use of this great platform/framework? Other than World Time Capsule, this site is built using RubyOnRails, as are several more that we’ve done recently: Global Health Source, 11 Recruitment, and Planning Your Get Away. We are currently redesigning our company Intranet using Rails, building a fully fledged eCommerce site for an up and coming clothing retailer and developing an intranet for Five Senses Coffee to help them manage their orders and interaction with their clients.
I think you could safely say that Spin is now firmly running on Rails. In an upcoming post, I’ll look at exactly how Ruby On Rails is used to build a site.