etckeeper allows the contents of
/etc be easily stored in Version Control System (VCS) repository.
It hooks into apt to automatically commit changes to <code>/etc
when packages are installed or upgraded.
under version control is considered an industry best practice,
and the goal of etckeeper
is to make this process as painless as possible.
sudo apt-get install etckeeper bzr
# The VCS to use.
bzr nick «$(hostname) /etc repository»
etckeeper commit «first adding of /etc»
Now you have local repository in /etc/.bzr
and can revert your configs if you have made something wrong like rm -rf /etc/apache2 (O_o! UPS!!!!)
How to work with bzr:
look at logs:
bzr log --short /etc
look at logs with changed files:
<strong>bzr log -v --short /etc</strong>
look at last 20 logs:
bzr log --line /etc | head -n 20
look at changes from last commit:
bzr status /etc
look at chenges betweet last commit and current state:
bzr diff /etc
look at diff between two version of commits:
bzr diff -r 8..7 /etc
look at logs in verbose mode:
bzr log -p /etc/squid3 | less
bzr revert -r5 /etc/squid3/somefile
bzr revert -r5 /etc/squid3
bzr revert /etc/squid3