2006-12-15

versioning /etc with subversion

Although portage takes care of configuration files very well, no system can have enough protection from human errors. Versioning configuration files under /etc is a nice solution to this. If you do a mistake and delete some file or any other silliness that might happen , you just revert to a former revision and solve the problem.

This can be achieved very easily:

  1. First create a svn repository
    svnadmin create /root/svn
    
  2. Then import /etc to the repository
    svn import /etc file:///root/svn -m 'Initial import'
    
  3. Checkout the project
    rm -rf /etc
    svn ci file:///root/svn/etc
            
    

Now change some configuration files and do 'svn status' When you change your configuration files you can commit them to the repository:

cd /etc
svn ci -m 'Changed MAKEOPTS=j2 in /etc/make.conf'
Linux rulez!