Difference between revisions of "Etckeeper"

From ArchWiki
Jump to: navigation, search
(Created page with "Etckeeper lets you keep /etc under version control. == Install == Get {{AUR|etckeeper}} from the AUR. == Configure == The main config file is {{ic|/etc/etckeeper/etckeep...")
 
(Add Category. See Help:Category.)
Line 1: Line 1:
 +
[[Category:System administration]]
 
Etckeeper lets you keep /etc under version control.
 
Etckeeper lets you keep /etc under version control.
  

Revision as of 03:33, 2 August 2013

Etckeeper lets you keep /etc under version control.

Install

Get etckeeperAUR from the AUR.

Configure

The main config file is /etc/etckeeper/etckeeper.conf. You can set things such as the VCS to use in this file.

Once you've set your preferred VCS (the default is git), you can initialize the /etc repository by running

# etckeeper init

Usage

Etckeeper supports using pacman as a LOWLEVEL_PACKAGE_MANAGER in etckeeper.conf. Support for using pacman as a HIGHLEVEL_PACKAGER_MANAGER is not yet added, so you'll need to either commit changes manually or use one of the stopgap solutions below.

Cron

There is a cron script in the source distribution at debian/cron.daily. You can use this script to automatically commit changes on a schedule. To make it run daily, for example, make sure you have cron installed and enabled, then simply copy the script from the srcdir where you built etckeeper to /etc/cron.daily and make sure it's executable (e.g. chmod +x /path/to/script).

Wrapper Script

In order to emulate the auto-commit functionality that etckeeper has on other systems, you could place a script such as the one below somewhere in your PATH, make it executable, and use it instead of pacman -Syu to update your system.

#!/bin/bash

etckeeper pre-install
pacman -Syu
etckeeper post-install

Incron

As an alternative to the above, you could set up incron to automatically commit changes using etckeeper whenever a file in /etc is modified.