-4

I'm looking for a way to keep user and system-made changes to /etc using etckeeper seperate automatically.

Basically different commits for user and system. I'm sure many other sysadmins could benefit from this too.

To clarify, each server has roughly 2 kinds of knowledge: user-generated, auto-generate. Mixing them together is like mixing /usr/local and /usr. You are wasting time going through massive diff lists of automated changes. It is like developing a Rails application and having each diff list get spammed by changes in ActiveRecord. When its time to replicate the system or find an old manual change you'll be looking for a needle in haystack. This no fun as some times it took ages to figure out a solution.

Not asking anyone to build anything, but if you have a ready solution, I wouldn't want to re-invent the wheel.

jiriki
  • 1
  • 1
  • 1
    What's wrong with [etckeeper](http://joeyh.name/code/etckeeper/)? – mgorven Jul 14 '12 at 18:34
  • Theres nothing wrong with etckeeper. The problem is that commits are spammed by changes that are APT etc. done. Dozens of config files and other crap gets updated all the time, and I have nothing with them. They're mostly fine, as they are completely automated. Every server has basically two kinds of knowledge: - User-generated - Auto-generated Mixing them two is adding a lot of noise. Its like monkey-patching a library in /usr/lib and then five months later unable to find the change because 1000 other things changed in lib. – jiriki Jul 15 '12 at 19:00
  • I don't see how people rate this -3 though. Are people enjoying going through massive diff lists and searching a needle in haystack? I am not. – jiriki Jul 15 '12 at 19:05
  • Your question is getting downvoted because it is not really clear what you are asking, sounds like a [product/shopping recommendation](http://blog.stackoverflow.com/2010/11/qa-is-hard-lets-go-shopping/) and is so general that no can really give you a decent answer. Please read the [FAQ](http://serverfault.com/faq) and re-focus your question to one that is answerable instead of a very general "I don't like this, what else can I do?". –  Jul 15 '12 at 22:19
  • My question is: how to automatically keep user and system level diffs separate? I edited the OP. I don't think the question itself is vague but my phrasing might have been. – jiriki Jul 17 '12 at 09:54
  • @jiriki use `sudo` for manual commits. `etckeeper` then logs those commits as being made by the user executing the command, instead of root. That way you can tell them apart from "automated commits". – Izzy May 04 '18 at 14:04
  • Yeah that is one solution. – jiriki May 14 '18 at 04:15

1 Answers1

1

If you always manually commit changes you make using etckeeper you can just filter the commits to remove all automated commits. For example, using Bazaar:

% sudo bzr log --line | egrep -v 'daily autocommit|apt run|puppet catalog run'
mgorven
  • 30,036
  • 7
  • 76
  • 121
  • Yeah thanks, that's one solution, but sysadmin would still have to commit every time sysadmin makes changes. When sysadmin forgets it, the changes will be lost to the deep space of auto-commits. Given that most changes are made with text editor like vim, it could actually just commit every time use makes changes, and amend the changes to last commit. Renames, copy's etc. would still go to other commits. To take that into account, you'd have to script bash I guess. Needs a bit of scripting, I guess I'll do this unless someone has implemented this already. – jiriki Jul 17 '12 at 10:08