Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been reading about etckeeper, but I can't work out if you can use it on any other directories other than /etc.

There seems to be no reference to /etc in any configuration file (that I can find) so I assue this is hard coded and you can't chose directories to monitor. Is this true? I'd like to also have it manage /opt. Can this be done?

share|improve this question
up vote 10 down vote accepted

It is right there in the man page.

  • Create a directory /foo
  • Initialize with etckeeper: etckeeper -d /foo init
  • Commit apply commits to the directory: etckeeper -d /foo commit 'message'

But as ErikA mentioned you could just as easily use git or your favorite DVCS directly.

share|improve this answer
Ah yes I see now, I just had to play around with this option a bit until I could get the behaviour I wanted. Thanks :) – jwbensley Aug 13 '12 at 10:44
The reason for using etckeeper is that it keeps metadata like permissions for files. That makes it a very interesting upgrade to git for plenty of things. You can also wrap etckeeper -d /home/username in a bash/zsh/fish alias, then you could for example run homekeeper commit instead. – ufotds Feb 5 '15 at 19:44

Etckeeper is merely a wrapper for mercurial or git. It provides some nice hooks into package management tools to automatically grab a commit after updates, and optionally on a schedule. This additional functionality is most likely not needed outside of /etc.

Depending on your needs, I'd just use vanilla git (or any other version control tool you're familiar with). If needed, schedule regular commits via cron or as part of your application deployment process.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.