/etc
contains files involved in package management, so replacing these files with older versions may break respective software packages. Imagine you had /etc/foo/config
which contained a setting bar=0
at the time you made your backup. Then a newer version of foo
is released where bar
was renamed to baz
. When you install this package, /etc/foo/config
is also updated to replace bar
with baz
. If you now restore the old backup, foo
will complain about an unknown configuration parameter bar
.
This gets much worse when security is at stake. For example, restoring your backup may revert hardened security settings back to insecure ones. Imagine you had a setting crypto_algoritms=A1,A2,A3
, then a problem is discovered with A1, and it is removed from the settings. Restoring your backup will make your system vulnerable to a problem which is already fixed for everyone else, so this vulnerability may stick to your system for a long time.
If you want to make such backups in a useful way, you have several options:
keep a full image backup. Requires a lot of space.
use diff
and patch
to backup the changes you have done to /etc
. You may occasionally run into problems, but at least patch
will promptly warn you every time there is a problem. Requires very little space
write a script which makes the required changes, and keep backups of the said script. Requires very little space, and can also handle arbitrary commands like installation of missing packages.