I store configuration files under revision control

Submitted by root

Tags: none.

 

Never  <-> 64%386 votes
Sometimes  <-> 25%152 votes
Always  <-> 8%52 votes
Total 598 votes

Posted by ajt (84.12.xx.xx) on Sat 15 Oct 2005 at 14:10
[ Send Message | View Weblogs ]
Someone once suggested this, and it seemed like a good idea the time, but I've never got round to trying it out. I do however back up /etc...

--
"It's Not Magic, It's Work"
Adam

[ Parent ]

Posted by matej (158.193.xx.xx) on Sat 15 Oct 2005 at 15:20
[ Send Message ]
backing up is good idea :)

FYI I use rsa keys & unison, synchronizing all servers to one backup machine where all /etc's for different hosts are "rotated" with custom logrotate+diff-like scripts.

[ Parent ]

Posted by kamaraju (128.253.xx.xx) on Sat 15 Oct 2005 at 19:52
[ Send Message ]
I do not store them under revision control. But what I do is have a regular backup of /etc and if I change any file say xorg.conf I store this as xorg.conf_yymmdd in some directory. It is not as efficient as version control but it serves the purpose as /etc files are usually text and I only edit just couple of them (sources.lost, fstab, xorg.conf) .

[ Parent ]

Posted by Steve (82.41.xx.xx) on Mon 17 Oct 2005 at 13:45
[ Send Message | View Steve's Scratchpad | View Weblogs ]

I find rcs useful for this - as it lets you edit files in place, keeping the history in x.org,v for the file x.org.

It doesn't require a repository so it is very lightweight - plus it will allow you to easily see the differences between versions, something which is commonly useful on configuration files and hard to achieve with dated-backup files.

Steve
--

[ Parent ]

Posted by Anonymous (66.159.xx.xx) on Sun 16 Oct 2005 at 19:58
i cvs most of my rc files in my home dir, this way i can check them out on remote machines and when i am done, i just use an alias to remove all the checked out files. the only problem is that i have is some config files dont work on multi machines, like i have diff .conkyrc for desktop and laptop and i dont like .conkyrc.`hostname` format

[ Parent ]

Posted by Anonymous (216.239.xx.xx) on Wed 19 Oct 2005 at 15:16
Does anyone have some URLs on how to best set this up?

[ Parent ]

Posted by orchid (209.217.xx.xx) on Wed 19 Oct 2005 at 18:53
[ Send Message | View Weblogs ]
Joey Hess wrote an article about keeping ~/ in cvs which I am sure you could adapt for /etc
http://linuxjournal.com/article/5976

[ Parent ]

Posted by philcore (70.161.xx.xx) on Fri 28 Oct 2005 at 13:42
[ Send Message | View Weblogs ]
the subversion FAQs have a good simple example.

http://subversion.tigris.org/faq.html#in-place-import

[ Parent ]

Posted by antonh (129.13.xx.xx) on Fri 28 Oct 2005 at 21:09
[ Send Message ]
Hello

does anyone know an solution of using a rcs like svn, but without having the .svn directorys everywhere in /etc?

greetings
Anton

[ Parent ]

Posted by wilk (213.41.xx.xx) on Sat 29 Oct 2005 at 08:16
[ Send Message ]
You can use bazaar-ng and have only one `.bzr` directory on the top directory of /etc. `.bzr` will act as a repository, you don't need any other server configuration.

I don't use it for /etc, i prefer a classic incremental backup with cp -al and rsync -aH...

[ Parent ]

Posted by Anonymous (193.225.xx.xx) on Sat 29 Oct 2005 at 13:40
I think it would better to store /etc on a Versioning File System (like VMS have) and make regular backup.
Are there any well tested Versioning File System under Linux?

---
László Kiss

[ Parent ]

Posted by Anonymous (65.205.xx.xx) on Mon 31 Oct 2005 at 15:16
I use RCS on files outside of etc that I sometimes change several time a day (/usr/local/apache/conf), but for /etc I have a script in cron.daily that backs up /etc and keeps several revisions. I'm not the original author, but have modified to handle links and such. I can't remember where I found it. It requites the 'savelogs' script from debianutils. Here it is:
#!/bin/sh
#
# Save a copy of any file in /etc that has been changed.
# To be run daily from via cron
# RGB
#

#ert -x                  # Trace
#set -e                  # Exit on error

SRCDIR=/etc
DESTDIR=/var/local/etcBackup
CYCLES=10

/usr/bin/test -d $DESTDIR || mkdir -p -m755 $DESTDIR
cd $DESTDIR


for file in `/usr/bin/find $SRCDIR \(  -type f -o -type l \)`; do
    # Exceptions. Do not backup
    case $file in
        *~) /bin/rm $file; continue;;
        /etc/modules.conf.old) continue;;
        /etc/.serial.conf.old) continue;;
        /etc/sgml/*.old) continue;;
        /etc/webmin/webmin.acl.bak) continue;;
        *bak|*.dpkg*|*.old) echo "Check $file"; continue;;
        /etc/ld.so.cache|/etc/mtab|/etc/adjtime) continue;;
    esac

    # do nothing if file is empty
    test -s $file || continue

    if [ -e ./$file ]; then
        /usr/bin/cmp -s $file ./$file && continue
        /usr/bin/savelog -p -c $CYCLES ./$file >/dev/null
    else
        dir=`/usr/bin/dirname $file`
        test -d ./$dir || mkdir -p ./$dir
    fi
    /bin/cp -dp $file ./$file
done

[ Parent ]

Posted by daemon (196.25.xx.xx) on Mon 31 Oct 2005 at 20:11
[ Send Message | View Weblogs ]
Talking about revision control, does anyone here know how to have "custom" keyword tags in subversion?

I'm not sure if it's even possible, but from working with FreeBSD quite alot lately, I've noticed that alot of the system config files have what look like RCS style keywords, but with a $FreeBSD: $ tag rather than something more common like $Id: $.

I'd really like to have subversion do something similar, but using a format like $hostname: $ so that an "Id" style tag wouldn't overwrite the actual package release version that's often also in config files.

Anyone know how I might achieve this, or have any links?

Cheers.

[ Parent ]

Posted by Anonymous (24.232.xx.xx) on Tue 1 Nov 2005 at 04:43
I do not make mistakes on my PC :P

[ Parent ]