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 user.email email@example.com
- git config –global user.name “Configuration Admin”
- git remote add origin firstname.lastname@example.org:machineconf
Place git key in /root/.ssh
- 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.