versioning etc directory with etckeeper 2


The configuration directory / etc should be versioned for documentary reasons and for backup. All changes are visible at a glance and a previous state can be restored easily.
In / etc are also security-related information. Therefore, care should be taken when transferring and backup the repository on encrypting and restrictive file permissions.
Therefore, I use a private gitlab server.

install etckeeper:
apt-get install git etckeeper

Make sure, that /etc/etckeeper/etckeeper.conf contains
VCS="git"

Initialize git:
cd /etc
git config --global user.name "User"
git config --global user.email "user@example.com"
git config --global core.editor "vim"

If you use your own gitlab-Server:
git remote add origin git@example.com:your-git.git

Initialize the git-Repo:
etckeeper init

And store everything:
git push -u origin master

Change /etc/cron.daily/etckeeper if you use your own git-Server:
Add after etckeeper commit "daily autocommit" >/dev/null
this line:
cd /etc; git push origin master;


Leave a comment

Your email address will not be published. Required fields are marked *

2 thoughts on “versioning etc directory with etckeeper