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?


It is right there in the man page.

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

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

| 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
  • 2
    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. – user68729 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.

| improve this answer | |

If you don't want to all the time provide "-d" you can put line:


into /etc/etckeeper/etckeeper.conf.
It's not in man, but it can be inferred from etckeeper script.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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