Sysadmins should pretty much version control everything

December 20, 2012

Today's Sysadvent contained a casual, matter of fact bit:

This code [for deployment scripts] has probably never been threatened with version control.

I had a reaction to this.

At work, we are not quite hep to all the current DevOps coolness. We don't have metrics and dashboards, we don't have everything automated with things like Puppet, Chef, or Cfengine, and so on. But even in our low state of evolution, we do version control pretty much everything that moves. Our almost invariable rule is that anything that we change gets put in version control first. Scripts, configurations, etc etc.

Here is the thing. Doing this is trivial. You don't need to start up some big version control infrastructure or system to keep /etc in a big repository, you don't have to decide between git and Mercurial, and you barely need to do anything extra.

Just use RCS. RCS is a trivially easy single-file version control system. You don't have to set up anything big or make any particular changes in how you work. All you need to do (after a quick initial setup) is to run one more command after you edit something and are satisfied with your work (commit messages are optional but useful). And for doing that, you get all of the usual version control goodness; you can see what changed and when, and you can revert back to a past version (or pull bits of it out). Since RCS operates on single files, you can use it selectively, in mixed and tangled directories like /etc, and only when you need it.

By the way, don't worry that using RCS instead of something more sophisticated will prove a terrible decision in the future. You can migrate from RCS to other things when you reach that point.

(My writeup was for Mercurial, but you can use CVS-to-git stuff to move to git too.)

Sidebar: what it takes to use RCS the easy sysadmin way

apt-get install rcs
mkdir RCS
ci -l <file>
rcs -U <file>
[edit]
ci -u <file>
[edit]
ci -u <file>

There. You're done. Repeat the last two steps every time you edit the file (really, the last step, since you're already editing the file).

(Obviously some of the the initial steps can be skipped after the first time or the first time in any particular directory.)


Written on 20 December 2012.
« Part of good awk programming is getting the clause order right
Version control comes first »

These are my WanderingThoughts
(About the blog)

Full index of entries
Recent comments

This is part of CSpace, and is written by ChrisSiebenmann.
Twitter: @thatcks

* * *

Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web

This is a DWiki.
GettingAround
(Help)

Search:

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Thu Dec 20 03:14:15 2012
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.