Maintain config-files using subversion

Every sysop might recognize this… I changed a config file some while ago… but what did I change and what is the history of that file. Besides of the changes, I want to have them in a backup :-)

So I decided to setup a config-file repository, where the servers can commit automaticly their changes using SVN over SSH. I use SSH to have no password prompts but certificates. Only the user svn-backup can commit files to the repository. On both server I only checked out the repository-part concerning them.

[[email protected]] svn co
svn+ssh://[email protected]/repos/config-files/tank
/usr/data/svn-config

And in the crontab for the user root, we have the next entry:

45 * * * */usr/local/backup/svn-backup.sh

And in the svn-backup script we have the next lines:


#!/bin/bash
#
# Subversion script to backup configfiles
#
# Written by Pieter de Rijk <pieter -at- de-rijk.com>

SVN_BACKUP_PATH=”/usr/local/svn-backup”

cp -R /usr/local/etc/ $SVN_BACKUP_PATH/usr/local/etc/ > /dev/null 2> /dev/null
cp -R /etc/
$SVN_BACKUP_PATH/etc/ > /dev/null 2> /dev/null
rm -rf $SVN_BACKUP_PATH/usr/local/etc/squid/errors
rm -rf $SVN_BACKUP_PATH/usr/local/etc/squid/icons/*.jpg
rm -rf $SVN_BACKUP_PATH/usr/local/etc/squid/icons/*.gif
cd $SVN_BACKUP_PATH
/usr/local/bin/svn up > /dev/null 2> /dev/null
for files in “`/usr/local/bin/svn status $SVN_BACKUP_PATH | grep ^?`”;
do
   ADD_FILE=`echo $files | awk ‘{ print $2 }’`
   if [ ! -z $ADD_FILE ];
   then
     /usr/local/bin/svn add $ADD_FILE
   fi
done
/usr/local/bin/svn commit -m “[`hostname -s`] Config changes `date`”


And when something change I receive a message :-P

Only users in the wheel group can checkout the repositories, but are not allowed to commit :-D

make -j 32 bzImage

As I wrote before some vendor promissed me a 16-core machine…. and indeed we received it. Now I have my ‘toy’ placed in the basement. Besides of some trouble putting a modified version of RHEL 4.5 on it, it works fine. At this moment I’ve insta…

Install IBM servers from a distance

At my work, I needed to reinstall a server which is located in a datacenter in Amsterdam and I am located in Rijswijk. But the servers have a managament-interface (RSA 2 of IBM) and the capability to mount a local image to the server So I tried……

Server Tank died again

And again… Tank RIP.Yesterday evening I wanted to execute an update for the backup-mechanism… and I heard the sound of a poweroff So, now I am installing all the services on a old laptop of mine So hopefully all services are restored within …

WebDAV and Calendar files

For a long time I was having a fight with WebDAV… But I found the problem! In the http.conf file you need to put a line like:DAVLockDB /usr/local/apache/var/DAVLock/DAVLockDBThis is the Lock-database for WebDAV… but not only the file needs t…

VMWare on 64bit Gentoo

Currently I installed VMWare on a dual opteron system (with 4GB memory). At this moment I have installed the next virtual machines:Debian 4.0 r1RedHat Enterprise Linux 5Solaris 10Everything works fine and I use it to play with the different syste…