My company is evaluating Kiln (hosted) and one requirement is to back up all repositories locally.
Previously, Stefan wrote a backup script which you can find here. However, that script hasn’t been updated to use the new "token" API, stores passwords in plaintext, and has some other shortcomings.
I’ve written a new backup script that you can find here:
It uses the Kiln API to get a list of all available repositories from your account. It then backs up each one, using the “clone” command (for the initial backup) or the “pull” command (for subsequent backups).
Some features are:
- Correctly handles repositories with Unicode characters in their name.
- Uses KilnAuth, so it does not need to store passwords.
- Uses the new (required) "token" API.
- Tested on Windows, Mac OS X, Linux.
- Stores repositories in a directory hierarchy that mirrors your project/group/repo hierarchy on Kiln.
- Tries to continue backing up even if a repository fails, so you don’t miss the rest of your backup if one repo has a problem.
- Nice status messages that can be turned off using the
--quietcommand-line option.
The script should be considered experimental, but I think some Kiln users may want to try it out.
Update 2010-06-07: New features added:
- Back up only part of your Kiln account by using the
--limitcommand-line option. (This could make the script usable with Web Hooks, although this isn’t tested yet. I haven’t written the web component, which would be a PHP or ASP.NET page that runs the backup script.) - Update a working copy using the
--updatecommand-line option.