• Linux
  • April 2019
    M T W T F S S
    « Mar   May »
    1234567
    891011121314
    15161718192021
    22232425262728
    2930  
  • Meta

  • Follow me on Twitter

  • Advertisements

My Config Files

Over the past few months, I’ve seen a few ways to keep backups of my important configuration files. The idea of setting up a git bare repository interesting and I’ve seen a couple of ways to implement it but I haven’t done it yet.

What I have done is create a folder in a directory that get synced to all of my Linux computers to hold copies of my configuration files and I wrote a script to back them up to that directory on my main system. I consider the configuration files on my main system to be the master copies. Where there I variations I save them with an appended file name. For instance, I have three different versions of nano on my network, one for Mint 18.3, 19.1, and LMDE 3. Each of them supports different options and syntax highlighting.

Yesterday, I created a script to copy my modified configuration files into my home directory. The script is menu-based so it only copies the files I want. If I need to copy more than one file, it continues to offer me choices until I choose the option to quit.

I wrote functions to handle each configuration file option and made allowances for different versions of a file or special situations. In the function that copies the .nanorc, it checks the version of nano on the computer and copies the appropriate .nanorc file.

At the moment I two systems running Debian-based distributions, Linux Mint Debian Edition and MX-Linux. On both of these systems I’ve had problems with making sure my ~/bin directory was added to my path if I had logged in to the GUI login. Previously, I had gone into the terminal’s preferences and had it run as a login shell.

The function that handles the .bashrc checks /etc/os-release to see if the distribution is based on Debian or Ubuntu. If it’s Debian, after it has copied the .bashrc file, it appends it with two lines to check for the existence of ~/bin and add it to the path if necessary.

I haven’t thoroughly tested it yet but I’m certain it will work properly. I’ll proofread it and I might still tweak it a bit. Sometimes I see things differently when I put it aside for a while.

Advertisements
%d bloggers like this: