Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 several Linux workstations, including servers on which I often make critical changes and would be happy to be able to roll back them in case I break something.

I therefore consider versioning critical folders like /etc but I was wondering if other folders are important to keep under revision control. What would be your policy?

What I would include as as start in this policy is:

  • Do not version /var/log or other always changing folders (do you have other examples?)
  • Version /etc
  • Do not nest repositories
  • Version all critical services configuration outside of /etc, any idea?

It would be great if more rules could be found, otherwise I can give more details about my specific problem:

  • I am using Arch Linux on my workstations and laptops
  • I am using OpenSuse on the servers I am responsible of
  • These servers are production servers, meaning if I break the apache server on them and cannot quickly rollback them I leave all my coworkers in the dark.
  • I use git as a revision control for our source code, but if another system is more suited to this task I would take it.
share|improve this question
up vote 1 down vote accepted

It is reasonably common for sysadmins to keep system config under version control.

The simplest method is to use etckeeper, which can do this with minimal manual setup and can interface with several different VCSs. It's reasonably well known (is probably in your distributions' repositories; was described in the official Ubuntu Server docs, ...)

Some advantages of using it rather than manually maintaining your VCS repository:

It hooks into apt (and other package managers including yum and pacman-g2) to automatically commit changes made to /etc during package upgrades. It tracks file metadata that revison control systems do not normally support, but that is important for /etc, such as the permissions of /etc/shadow.

(from the homepage's description).

For a discussion of etckeeper alternatives (aimed at sysadmins), see also this question on Unix and Linux.

System-wide configuration is supposed to go in /etc/ on Debian-like systems at least; I assume it's similar for other distributions. As long as the programs you have installed are well-behaved, your critical services should have their configuration in /etc/.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .