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
- Download a list of all files in /etc
- Download a list of all .deb packages installed
Then, on the original server,
- Expand all .deb into /tmp/etc1 and see which /etc files they install
ls /tmp/etc1 > /tmp/listOfOrigEtc
ls /tmp/etc > /tmp/listOfEtc
diff /tmp/listOfEtc /tmp/listOfOrigEtc > /tmp/listOfFilesToDownload
- Download all new etc files
- 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:
It'll list those config files which have been changed from the defaults. Alternatively:
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)