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

Re: script for on-disk configuration file backup



Tomas Pospisek suggested CVS storing configuration files as you go:

> On Wed, 9 May 2001, Steve M. Robbins wrote:
> 
> > #!/bin/sh
> > #
> > # Save a copy of any file in /etc that has been changed.
> 
> Just an idea - what about dropping it into CVS?

Even simpler, just use RCS on every configuration file that you edit
by hand.  Couldn't be simpler if you are already using emacs.  Just

	C-x v i 	the first time, and
	C-x C-q		each subsequent visit = check in/out.

If you think it is going to be altered by a script just check it in
and check it out straight away, so that the checked out version is
writeable.  The logs are very helpful, as is rolling back with

	C-x v c		cancel most recently checked in version.

Also, it then becomes trivial to back up your configuration files,
because the RCS archive has ",v" appended and may be additionally
stored in an "RCS" subdirectory if you have made one.

    find /etc -name '\*,v' \
	| tar --create --gzip --file=configs.tar.gz --files-from=-

would be a start.


Cheers,

Andrew



Reply to: