Python
- 2 minutes read - 374 wordsOne of the fringe benefits of working in a software company is the fact that
we’re stacked out with very knowledgeable and exciting people. For Talis, this
goes double, as some of the programmers are the team building the Talis
Platform. I work in the Platform Live
Services team, and we are responsible for
services around the Platform. At the moment, I’m looking at backups. I will
blog more on this at our work blog, but
at the moment, I’m just starting to work out how I would back up a Platform
store. The team have implemented a cool API for this, so for me it’s just a case
of learning how to do it. I started working in shell
script, but it rapidly turned into a very
difficult project. Date arithmetic in shell script is inordinately painful… I
spent two hours writing shell script, and managed to get a shell script that
would increment the date (so I could specify “tomorrow” as the backup time). I
explained this to my manager, who looked at me pityingly and pointed out that
the date command on CentOS includes a parameter to
do this. So some very ugly shell script went out the window.
When I talked to the Platform dev team, however, they suggested using Python instead. I decided to give it a go, and was amazed by how simple it all was. Yesterday, I managed to generate a backup instruction file, which the Platform accepted. I’ve just logged on to the Platform store, and my backup has succeeded. So, the project for the next few days is to refine the code so that I can do automatic backups of the stores as needed.
Of course, while I’m writing all this script on CentOS at work, my Macs at home also have Python installed, so I can see myself moving to Python for other tasks here. Python makes it much easier to handle information from the Internet, for example. I was dreading having to write script to parse out the name of the snapshot backup file from the page that the Platform hands you when you ask for the list of snapshots.
What’s your favourite scripting language? Anything I’m missing here? Feel free to comment…