14 Jun 2010

An Alternative to Dropbox using Bazaar

Ubuntu One is great in theory, but I have not been able to get it working in a way that I can rely on. I am constantly experiencing connection issues and finding it randomly crashes, so until that becomes more stable it remains shelved as I need something reliable and don't have the time to keep an eye on it. I recently read about SparkleShare which looks like a very easy to use take on version control (it's built aroung Git). But its not actually officially released yet, so I'll be keeping an eye on that one. I've been using Dropbox in the mean time, which is really great, for a lot of reasons. Problem is that it's not free and the version control side things seems to be very limited and I can't host my own files, I use it and enjoy it's ease of use but I never really wanted to use it. When I saw this post on the sync box (a non-dropbox solution to syncing files across different computers using Mercurial) I was inspired to do something similar and re-usable with Bazaar. The company I work for has a dedicated server with loads of space and bandwidth so I started by initializing a project in my home directory there. I then branched that project on my desktop and added a sync directory inside it with the following scripts: server
#!/bin/bash
bzr update
client
#!/bin/bash
bzr add
bzr remove
bzr commit -m "Update"
bzr push
bzr pull
sync
#!/bin/bash
cd $HOME/notdropbox
sync/client
I also added a README file to remind myself because I could be forgetful. I copied the file named sync to my home directory then pushed the project back to the server. Now the project has a stored push and pull location and should push and pull quietly. I set up a cron job to run the sync script every so often. I then went back to the server and set up a cron job to run the server script at regular intervals to update the project with pushed revisions. After that its just a case of branching the project on other computers I use and setting up a cron job, if I want a cron job. Another advantage to using Bazaar is that if I want to quickly get my files on a colleagues computer there is no configuration or sharing folders, I can simply just branch the project get what I need then discard it, if you know what I mean? So thanks to Paul Bissex at e-scribe.com for inspiring this one.