summaryrefslogtreecommitdiff
path: root/localbackupconfig
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-03-29 13:33:06 +0000
committerJonas Smedegaard <dr@jones.dk>2002-03-29 13:33:06 +0000
commit26703710628cc79127bc4952448ae37aa79401eb (patch)
treef273e0bd6884dea9708c8d6f09aad6acc3a64776 /localbackupconfig
parent9967bb7063b9ce81a8f85a15641ac96090ccf3b7 (diff)
Remove localrmtoobig stuff (ooops!).
Handle /etc/local-$FQDN. Really handle .orig items also. Use dirname to make sure we use the correct directory (instead of an extra directory with the samen name below).
Diffstat (limited to 'localbackupconfig')
-rwxr-xr-xlocalbackupconfig15
1 files changed, 10 insertions, 5 deletions
diff --git a/localbackupconfig b/localbackupconfig
index 8176da7..5f39fce 100755
--- a/localbackupconfig
+++ b/localbackupconfig
@@ -3,7 +3,7 @@
# /usr/local/sbin/localbackupconfig
# Copyright 2001 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localbackupconfig,v 1.2 2002-03-29 12:59:48 jonas Exp $
+# $Id: localbackupconfig,v 1.3 2002-03-29 13:33:06 jonas Exp $
#
# .dpkg-new files appear when refusing to update a conffile on package update
#
@@ -14,9 +14,14 @@
FQDN=`hostname -f`
BACKUPDIR=/var/local/backups/$FQDN
+LOCALCONFIGDIR=/etc/local-$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 $LOCALCONFIGDIR ]; then
+ mkdir -p $BACKUPDIR/$LOCALCONFIGDIR
+ cp -fa $LOCALCONFIGDIR $BACKUPDIR/`dirname $LOCALCONFIGDIR`/
+fi
+changedfiles=`find /etc -name '*.old' -o -name '*.orig' -o -name '*.dpkg-new' | sed -e 's,\.\(old\|orig\|dpkg-new\)$,,' | grep -v "^$LOCALCONFIGDIR" | sort -u`
+for i in $changedfiles; do
if [ -e $i ]; then
if [ -e $i.dpkg-new ]; then
orig="$i.dpkg-new"
@@ -25,11 +30,11 @@ for i in `find /etc -name '*.orig' -o -name '*.dpkg-new' | sed -e 's,\.\(orig\|d
elif [ -e $i.old ]; then
orig="$i.old"
else
- echo "What the f... Original for \"$i\" has disappeared again?!?"
+ echo "What the f... Original for \"$i\" has disappeared?!?"
exit 1
fi
mkdir -p $BACKUPDIR/`dirname $i`
- cp -fa $i $BACKUPDIR/$i
+ cp -fa $i $BACKUPDIR/`dirname $i`/
diff -ruN $orig $i > $BACKUPDIR/$i.diff
fi
done