Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #208011

Re: How do I trace changes in configuration files?

From Dan Purgert <dan@djph.net>
Newsgroups linux.debian.user
Subject Re: How do I trace changes in configuration files?
Date 2019-05-01 13:40 +0200
Message-ID <xSVKF-3WH-1@gated-at.bofh.it> (permalink)
References <xSTSx-2Nt-7@gated-at.bofh.it>
Organization A noiseless patient Spider

Show all headers | View raw


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Erik Josefsson wrote:
> I'm trying to learn how to set up my two Teres laptops so that they are 
> identical.
>
> [...]
>
> I have tried to document my personal preferences before, but I have 
> always ended up with unreadable handwritten notes.
>
> This time I thought I should do it in a more systematic way by somehow 
> capture the difference between the default install and the result of my 
> (often irrational) efforts to make my machines look and feel like I want 
> it to.
>
> So, is there a way to trace/record/capture changes in all configuration 
> files?
>

There are as many as people reading this channel :)

Probably the simplest (and, to some extent, most error prone) is to
simply make copies, edit only the copies. For example:

  cp orig.conf orig.conf.$(date +%y-%m-%d_%H%M%S)
  vi orig.conf

and then you'll end up with stuff like 

  orig.conf
  orig.19-05-01_065356
  orig.19-05-01_104022
  (etc)

Then just use 'diff' against any two files to see what changed between
them.

Or you can use a revision tool. I ran across "rcs" a few years ago, and
while it's not something I always use, when I remember, it's pretty good
at what it does.

Either of these could be wrapped up in a little script --

  #!/bin/bash
  # 'rvi' - "revision-controlled" vi wrapper
  # create a backup then edit the original file

  cp -p "$1" "$1".$(date +%y-%m-%d_%H%M%S)
  vi "$1"

  ALTERNATE

  #!/bin/bash
  #'rvi' - revision control vi wrapper
  # use the 'rcs' tool to checkout/checkin files

  co -l "$1"
  vi "$1"
  ci -u "$1"

Personally I like vi, but if you don't, replace it with whatever your
editor of choice is.  The scripts probably have flaws that someone will
point out soon (like calling it with no file, or multiple files, etc).

> The idea is then to just replace the default configuration files with 
> the files where my preferences have been saved.

As far as actually propagating changes, that gets a little more
difficult -- but if all the config files are in $HOME/.config ... well,
just use a cronjob to sync daily or something.


-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAlzJgxsACgkQjhHd8xJ5
ooEKAwf/aUN+2DkbpzQKxEXkLWjCDXacI2MnvSUfpAOkxid4rcnNHZRqjuww2Kcj
caZj4D/T8P2Ah9HetitxRW8Cx22Z0cggM5WBIquEssAPT833mp8F5uCgFADVZ0O7
Z5xoZP9+DW3umcVnjdEfT844xFsL5dRmKmZ31HAQQlVSBbzvMxFwjjkowVE4zcTg
YYRm4uPPqW5JNPa9Q4j9lb5Cv3w54v31OVKS62QCYZs9Nenr4L2e7/J+lO9XKAcG
l6LR/9ay2A9ItlqmNnnEZSaoAOxKrScqIGnVwDe9HtKIpm4mBU0/m18ROOqhqO5c
dshWFqQ/o/6VPYf/JAVoG9obev9lOg==
=9ovY
-----END PGP SIGNATURE-----

-- 
|_|O|_| 
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5  4AEE 8E11 DDF3 1279 A281

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How do I trace changes in configuration files? Erik Josefsson <erik.hjalmar.josefsson@gmail.com> - 2019-05-01 11:40 +0200
  Re: How do I trace changes in configuration files? Jonas Smedegaard <jonas@jones.dk> - 2019-05-01 13:00 +0200
  Re: How do I trace changes in configuration files? Dan Purgert <dan@djph.net> - 2019-05-01 13:40 +0200
    Re: How do I trace changes in configuration files? Erik Josefsson <erik.hjalmar.josefsson@gmail.com> - 2019-05-01 18:50 +0200
      Re: How do I trace changes in configuration files? Dan Purgert <dan@djph.net> - 2019-05-01 19:30 +0200
      Re: How do I trace changes in configuration files? Joe <joe@jretrading.com> - 2019-05-01 23:20 +0200
        Re: How do I trace changes in configuration files? Jude DaShiell <jdashiel@panix.com> - 2019-05-02 00:10 +0200
      Re: How do I trace changes in configuration files? David Wright <deblis@lionunicorn.co.uk> - 2019-05-02 05:30 +0200
        Re: How do I trace changes in configuration files? Dan Purgert <dan@djph.net> - 2019-05-02 13:10 +0200
        Re: How do I trace changes in configuration files? Lee <ler762@gmail.com> - 2019-05-02 18:20 +0200
          Re: How do I trace changes in configuration files? David Wright <deblis@lionunicorn.co.uk> - 2019-05-02 22:20 +0200
            Re: How do I trace changes in configuration files? Lee <ler762@gmail.com> - 2019-05-02 23:00 +0200
  Re: How do I trace changes in configuration files? Andy Smith <andy@strugglers.net> - 2019-05-02 12:10 +0200

csiph-web