Debian – way to tell which files in /etc were modified

debianetcmirrorpackage-management

I want to create a mirror of my existing Debian server. I modified many files in /etc, and I don't want to redo everything by hand or download huge mirrors. What I thought of doing is

  1. Download a list of all files in /etc
  2. Download a list of all .deb packages installed

Then, on the original server,

  1. Expand all .deb into /tmp/etc1 and see which /etc files they install
  2. ls /tmp/etc1 > /tmp/listOfOrigEtc
  3. ls /tmp/etc > /tmp/listOfEtc
  4. diff /tmp/listOfEtc /tmp/listOfOrigEtc > /tmp/listOfFilesToDownload
  5. Download all new etc files
  6. Using find, see which /etc/ files were modified and download them

Is there a way to do this using a single command?

Best Answer

Install debsums package.

execute debsums as:

debsums --config

It'll list those config files which have been changed from the defaults. Alternatively:

debsums --all

Will show every changed file, including config files.

Rather handy!

Something to remember though... this utility can not be used to discover files which were created separately... only those files which have been modified from the originally installed version.

Creative use of the ctime and mtime file/dir stats can be useful here.

(I've been doing work on this particular topic myself lately, cloning systems)

Related Question