[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dbackup possibility



That would be quite useful for something different (or this can be
subsumed into dbackup): I've got a makefile (appended) that I use to
look at all the non-homedir files on my system and compare the list to
/var/lib/dpkg/info/*.list and *.conffiles, leaving me with information
about what files are installed but not in packages (and what files
should be installed but for some reason aren't, but that's more an
issue of packages moving files.)

The purpose of this exercise is to catch all of the things I dumped on
top of my debian installation to get work done (including an old
/usr/local and /usr/unsupported; my previous installation was MCC
based, and I'd done a *lot* of addition to it.) This lets me create
crude binary packages that are copied from the files already in place;
I then reinstall the packages (overwriting the existing files with the
packaged identical copies) thus updating /var/lib/dpkg. In the future,
when I have real packages for CFS, STRN, and CNS5, I can just install
them, and the crufty versions go away automatically, or I can decide I
don't need them after all and just --purge them.

(If I sound enthusiastic here, well, I am! Right now there are fewer
than 500 unaccounted for files on a partition with 22000 files on it,
which makes me very confident that I can duplicate or restore this
configuration fairly quickly.)

I'd guess that dbackup would generate the same information -- it would
be the list of files it is backing up, minus the things listed as
config files?
					_Mark_ <eichin@cygnus.com>
					Cygnus Support, Eastern USA

================ Makefile ================
all: diffs

DIRS=/ /usr/unsupported/ /usr/athena/ /usr/openwin/ /usr/vice/ /usr/cygnus/ /usr/src/ /usr/cygnus/cns5/

info:
	ln -s /var/lib/dpkg/info

allfiles:
	-find ${DIRS} -xdev -print \
		| grep -v '^/var/lib/dpkg' \
		| grep -v '^/root' \
		| grep -v '^/usr/lib/perl5/i486-linux' \
		| grep -v '^/var/spool/uucp' \
		| grep -v '^/var/run' \
		| grep -v '^/var/log' \
	> allfiles

allfiles.sort: allfiles
	sort -o allfiles.sort -u allfiles

star.list: info
	rm -f star.list star.files
	dpkg --list | awk '/^ii/ { print $$2 }' | while read i; do \
		cat info/$${i}*.list >> star.list; \
		cat info/$${i}*.conffiles >> star.list; \
		echo $${i}.list >> star.files; done

star.list.sort: star.list
	sort -o star.list.sort -u star.list

diffs: star.list.sort allfiles.sort
	diff -ur allfiles.sort star.list.sort > diffs

.PHONY: allfiles star.list

clean:
	rm -f allfiles allfiles.sort star.list star.list.sort star.files


Reply to: