One of the most frustrating things in the world being a developer is losing code. So there’s very few things that I make sure to take extra care in than source code backup.
Of course I use version control via subversion on a service called Beanstalk. Yes, I know that GIT is better, I just grew up on subversion.
First off, when I check out my repositories on my local machine, I have the repository directory nested in my Dropbox Pro folder. I have Extended History turned on in my Dropbox which means it keeps each and every version of each file for a year versus the standard thirty days.
Now comes the post-commit process. On every single commit, the following occurs:
- Gets checked into subversion (with commit message required)
- Automatically deploys on development server
- Then on my local machine:
- Tars the entire project and places it in a temp directory
- Copies the project to my Google Drive
- Copies the project to Dropbox
- Copies the project to my 4 terabyte external hard drive
- Copies the project to an Amazon S3 bucket in California
- Copies the project to an Amazon S3 bucket in Virginia
- Copies the project to an Amazon S3 bucket in Tokyo that has a lifecycle rule applied to automatically retire all files in that bucket to Amazon Glacier after 24 hours
- Removes the tar archive from the temp directory
I realize that it’s a tiny bit excessive but I’m not lying when I can’t stand losing code.