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.

[root@tank] 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

Set up an open-wifi network…

Currently I use WEP encryption to secure my private WLAN. But WEP is little bit old… and hackable. So I tried to setup WPA on my Linux-laptop, but with no success I don’t know what I do wrong, although I don’t want invest a lot of time in it. …

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 …