In an effort to track changes on my many Linux boxes, I’ve installed etckeeper which tracks all changes to /etc. It comes with a nice hook into apt which autocommits anytime a package is installed.

In addition to keeping the changes in a git repo, I’ve started pushing to a central repository which is managed with gitolite. I’ve setup etckeeper with the following steps:

As root in /etc

  • git config –global
  • git config –global “Configuration Admin”
  • git remote add origin

Place git key in /root/.ssh
As root:

  • cd /etc/etckeeper/commit.d
  • (echo ‘#!/bin/sh’ ; echo ‘git push origin’) > 99git-push
  • chmod +x 99git-push
  • git add .
  • git commit -m “automatically push commits to backup repository”

I won’t go into all the details of setting up gitolite, but it makes it very easy to create repositories and assign permissions. See the gitolite admin guide for all the details on setting it up.