Centralized management of dotfiles

Hello,

I am relatively new to Unix administration, and I cannot find any software for version-controlling and backing up dotfiles that are scattered throughout the file system tree and across several local machines. I've seen software like Restic, BackupPC, Etckeeper, and rcs, but I'm not sure I understand how they work, or they don't meet my criteria for : centralization + version control + backup, without duplicating code through copies like I might do with a Fossil repo. Although, once centralized, backups are easy.

I also considered using shell scripts or a database, but that seems overly complicated for such a small gain. In large infrastructures, this isn't done haphazardly, so how do you manage it?
 
CVS or git over ssh, with an install script in that directory.

You dotfiles should not be scattered to many places. What files are you thinking of that are not in your homedir?
 
Emacs




you can use tramp to tangle the files to a remote machine as well
 
poor mans answer.
I make a directory /home/x/Conf
Then i take the .conf files which are very relevant and put them in Conf and put a softlink.

But .dotfiles are problematic. Eg do rm -vfR /home/me/.cache , and your fontcache is gone.
 
the advantage of emacs is you have all you dotfiles in one file
which you then tangle ( write out ) into place

rather than opening files one by one and editing them
much faster
 
These days I don't bother worrying too much about it. But, I used to just have directories for it in a folder mounted under / to hold the originals and simlink those to the relevant places. That directory itself is easy enough to use your favorite revision control system to handle. Technically, revision control and not source control is what you want, but I don't know that the difference is really that relevant to what's likely to be a small collection of files.

Where I personally have the most problems is remembering to use the version tracking. If I had the interest, I'd probably just write a script to do it the way that there's a script for things like dealing with crontab and the adding/editing users. One script to get the file, open it in your favorite editor and update ask to install/update it in the repo.
 
not really a dot file user here, but lately I have been trying to use mise dot track file dont like much that each time you track something new there is a new commit even if you forgot to undo something, so you get extra "steps" in the history... hehehe... also not many things build for freebsd so mise kind of fails installing sometimes developer tools and things like that...
 
First off, dot files shouldn't change that frequently so version control seems like overkill. However you probly DO want to back up your .mozilla and .thunderbird, etc directories. In my backups the apropos files and directories get renamed as "dot-whatever-YYMMDD"
 
My dotfiles change constantly. Don't forget that one tree is shared across all Unix like OSes.

Backing up my browser profiles is something I don't do, my settings are in google and mozilla.org
 
I use Stow (mentioned above by froggit9000) not just for many of my dotfiles, but for all sorts of configuration too.

I'm very happy with my system; it has made my configuration management much simpler and less error-prone than it had been before I came up with it. Whenever I've described it here before, a lot of people have thought I'm crazy, and that my system is total overkill. For my part, I agree with the "I'm crazy", but it's perfectly OK with me if someone thinks it's "overkill" (I'm like, OK, that's cool, so just don't use it yourself, dude).

If you're interested, here's a thread that I made a year or two ago that was not directly about my system, but somehow at least partially devolved into people telling me I'm crazy and my system is overkill. I put some detail about the system (including the Stow-related parts) in there as the thread progressed. If you wind up with any questions about it -- preferably but not necessarily beyond "Are you crazy?" :p -- please feel free to ask.

Oh, and yeah, regarding other things mentioned in your question: I keep all of it (and far more stuff) in source control using Subversion, and back everything up in a variety of ways (including using Restic).
 
I store my personal dotfiles in ~/dotfiles under version control (devel/git], and I install them with a simple Makefile.

I also store system-wide configuration files (well, they are not dotfiles, but the idea is almost the same) in ~/sysfiles and use the same kind of a file structure that is used in my dotfiles repository I linked above, and install them with Makefile as well. E.g. there I will have etc/rc.conf, usr/local/etc/tmux.conf, and so on, and I can do make etc to install everything under etc into the same sub-location in /etc, and make /usr/local to do the same for usr/local, or just make to install everything I have. I especially like this because this way I can edit system files without a need to escalate privileges to root, and then just once execute make(1) command as root to install them.
 
First off, dot files shouldn't change that frequently so version control seems like overkill. However you probly DO want to back up your .mozilla and .thunderbird, etc directories. In my backups the apropos files and directories get renamed as "dot-whatever-YYMMDD"
That will depend, the main time that it's super worth it to use revision control is for when you're working out configuration. Personally though, the not dotfiles in places like /etc are more likely to be an issue.
 
Version control and the ability to go back to previous versions is essential for multi-machine dotfile keeping. It is way too easy to do something for a new emacs that breaks when logging in to a machine with the old emacs.
 
At least in terms of my shell I've settled on having a .bash_profile and a .bashrc that is the same across all systems and then source a .bash_profile_local and a .bashrc_local. There's surprising little that has to be the in the _local files. Other dot files I generally don't worry about.
 
Back
Top