1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head xmlns="http://www.w3.org/1999/xhtml">
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title xmlns="">etckeeper</title>
7
<link rel="stylesheet" href="../../libs/ubuntu-book.css" type="text/css" />
8
<link rel="home" href="index.html" title="Ubuntu Server Guide" />
9
<link rel="up" href="other-useful-applications.html" title="Chapter 22. Other Useful Applications" />
10
<link rel="prev" href="pam_motd.html" title="pam_motd" />
11
<link rel="next" href="byobu.html" title="Byobu" />
12
<link rel="copyright" href="legal.html" title="Credits and License" />
16
<img id="topcap" alt="" src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-top.png" />
17
<div id="layout" class="container clear-block">
18
<script xmlns="" src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
19
<script xmlns="" type="text/javascript">
20
_uacct = "UA-1018242-8";
24
<div id="logo-floater">
26
<a href="https://help.ubuntu.com" title="Ubuntu Documentation">
27
<img alt="Ubuntu" id="logo" src="https://help.ubuntu.com/htdocs/ubuntunew/img/logo.png" />
32
<form action="http://www.google.com/cse" id="cse-search-box">
34
<input type="hidden" name="cx" value="003883529982892832976:e2vwumte3fq" />
35
<input type="hidden" name="ie" value="UTF-8" />
36
<input type="text" name="q" size="27" />
37
<input type="submit" name="sa" value="Search" />
42
document.write('<form action="https://help.ubuntu.com/search.html" id="cse-search-box">');
43
document.write(' <div>');
44
document.write(' <input type="hidden" name="cof" value="FORID:9" />');
45
document.write(' <input type="hidden" name="cx" value="003883529982892832976:e2vwumte3fq" />');
46
document.write(' <input type="hidden" name="ie" value="UTF-8" />');
47
document.write(' <input type="text" name="q" size="27" />');
48
document.write(' <input type="submit" name="sa" value="Search" />');
49
document.write(' </div>');
50
document.write('</form>');
53
<a href="https://help.ubuntu.com/">
54
<img alt="Official Documentation" src="https://help.ubuntu.com/htdocs/ubuntunew/img/help-about.png" />
55
<span>Official Documentation</span>
61
<div class="breadcrumbs"><a href="https://help.ubuntu.com/">Ubuntu Documentation</a> > <a href="https://help.ubuntu.com/11.04">Ubuntu 11.04</a> > <span class="breadcrumb-link"><a href="index.html">Ubuntu Server Guide</a></span> > <span class="breadcrumb-link"><a href="other-useful-applications.html">Other Useful Applications</a></span> > <span class="breadcrumb-node">etckeeper</span></div>
62
<div xmlns="http://www.w3.org/1999/xhtml" class="sect1" title="etckeeper">
63
<div class="titlepage">
66
<h2 class="title" style="clear: both"><a id="etckeeper"></a>etckeeper</h2>
71
<span class="application"><strong>etckeeper</strong></span> allows the contents of <code class="filename">/etc</code> be easily stored in
72
Version Control System (VCS) repository. It hooks into <span class="application"><strong>apt</strong></span> to automatically commit changes to
73
<code class="filename">/etc</code> when packages are installed or upgraded. Placing <code class="filename">/etc</code> under version control
74
is considered an industry best practice, and the goal of <span class="application"><strong>etckeeper</strong></span> is to make this process as
78
Install <span class="application"><strong>etckeeper</strong></span> by entering the following in a terminal:
81
<span class="command"><strong>sudo apt-get install etckeeper</strong></span>
84
The main configuration file, <code class="filename">/etc/etckeeper/etckeeper.conf</code>, is fairly simple. The main option is which
85
VCS to use. By default <span class="application"><strong>etckeeper</strong></span> is configured to use
86
<span class="application"><strong>bzr</strong></span> for version control.
87
The repository is automatically initialized (and committed for the first
88
time) during package installation. It is possible to undo this by entering
89
the following command:
92
<span class="command"><strong>sudo etckeeper uninit</strong></span>
95
By default, etckeeper will commit uncommitted changes made to /etc daily.
96
This can be disabled using the AVOID_DAILY_AUTOCOMMITS configuration
97
option. It will also automatically commit changes before and after package
98
installation. For a more precise tracking of changes, it is recommended
99
to commit your changes manually, together with a commit message, using:
102
<span class="command"><strong>sudo etckeeper commit "..Reason for configuration change.."</strong></span>
105
Using the VCS commands you can view log information about files in <code class="filename">/etc</code>:
108
<span class="command"><strong>sudo bzr log /etc/passwd</strong></span>
111
To demonstrate the integration with the package management system, install <span class="application"><strong>postfix</strong></span>:
114
<span class="command"><strong>sudo apt-get install postfix</strong></span>
117
When the installation is finished, all the <span class="application"><strong>postfix</strong></span> configuration files should be committed to the
121
<code class="computeroutput">Committing to: /etc/
135
added network/if-down.d/postfix
136
added network/if-up.d/postfix
137
added postfix/dynamicmaps.cf
138
added postfix/main.cf
139
added postfix/master.cf
140
added postfix/post-install
141
added postfix/postfix-files
142
added postfix/postfix-script
145
added ppp/ip-down.d/postfix
146
added ppp/ip-up.d/postfix
147
added rc0.d/K20postfix
148
added rc1.d/K20postfix
149
added rc2.d/S20postfix
150
added rc3.d/S20postfix
151
added rc4.d/S20postfix
152
added rc5.d/S20postfix
153
added rc6.d/K20postfix
154
added resolvconf/update-libc.d
155
added resolvconf/update-libc.d/postfix
156
added rsyslog.d/postfix.conf
157
added ufw/applications.d/postfix
158
Committed revision 2.</code>
161
For an example of how <span class="application"><strong>etckeeper</strong></span> tracks manual changes, add new a host to <code class="filename">/etc/hosts</code>.
162
Using <span class="application"><strong>bzr</strong></span> you can see which files have been modified:
165
<span class="command"><strong>sudo bzr status /etc/</strong></span>
166
<code class="computeroutput">modified:
170
Now commit the changes:
173
<span class="command"><strong>sudo etckeeper commit "new host"</strong></span>
176
For more information on <span class="application"><strong>bzr</strong></span> see <a class="xref" href="bazaar.html" title="Bazaar">the section called “Bazaar”</a>.
180
<div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
182
<table width="100%" summary="Navigation footer">
184
<td width="40%" align="left"><a accesskey="p" href="pam_motd.html"><img src="../../libs/navig/prev.png" alt="Prev" /></a> </td>
185
<td width="20%" align="center">
186
<a accesskey="u" href="other-useful-applications.html">
187
<img src="../../libs/navig/up.png" alt="Up" />
190
<td width="40%" align="right"> <a accesskey="n" href="byobu.html"><img src="../../libs/navig/next.png" alt="Next" /></a></td>
193
<td width="40%" align="left" valign="top">pam_motd </td>
194
<td width="20%" align="center">
195
<a accesskey="h" href="index.html">
196
<img src="../../libs/navig/home.png" alt="Home" />
199
<td width="40%" align="right" valign="top"> Byobu</td>
205
<div id="ubuntulinks">
206
<p>The material in this document is available under a free license, see <a href="/legal.html">Legal</a> for details<br />
207
For information on contributing see the <a href="https://wiki.ubuntu.com/DocumentationTeam">Ubuntu Documentation Team wiki page</a>. To report a problem, visit the <a href="https://bugs.launchpad.net/ubuntu/+source/ubuntu-docs">bug page for Ubuntu Documentation</a></p>
211
<img src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-bottom.png" alt="" />