blob: 8176da740d8cd1ea5d15d0d14790eea00d9baac4 (
plain)
- #!/bin/sh
- #
- # /usr/local/sbin/localbackupconfig
- # Copyright 2001 Jonas Smedegaard <dr@jones.dk>
- #
- # $Id: localbackupconfig,v 1.2 2002-03-29 12:59:48 jonas Exp $
- #
- # .dpkg-new files appear when refusing to update a conffile on package update
- #
- # .orig files you should save yourself before customizing a configfile
- #
- # .old files are for customizing when you don't have the original (anymore)
- #
- FQDN=`hostname -f`
- BACKUPDIR=/var/local/backups/$FQDN
- find $BASE -path '*Attachments*' -size +15000k -exec rm '{}' ';'
- for i in `find /etc -name '*.orig' -o -name '*.dpkg-new' | sed -e 's,\.\(orig\|dpkg-new\)$,,' | sort -u`; do
- if [ -e $i ]; then
- if [ -e $i.dpkg-new ]; then
- orig="$i.dpkg-new"
- elif [ -e $i.orig ]; then
- orig="$i.orig"
- elif [ -e $i.old ]; then
- orig="$i.old"
- else
- echo "What the f... Original for \"$i\" has disappeared again?!?"
- exit 1
- fi
- mkdir -p $BACKUPDIR/`dirname $i`
- cp -fa $i $BACKUPDIR/$i
- diff -ruN $orig $i > $BACKUPDIR/$i.diff
- fi
- done
|