34
submitted 1 year ago by gkpy@feddit.de to c/linux@lemmy.ml

on gentoo for example I have accrued a few files under /etc/portage that to my knowledge just have to live there...

right now I basically rely on my backups for this. but maybe somebody knows a clever way to handle this?

top 18 comments
sorted by: hot top controversial new old
[-] aurtzy@social.fossware.space 10 points 1 year ago

Maybe etckeeper fits your use case? It's specifically built for managing /etc files with version control systems. I can't say much about it since I've never used it, though.

[-] Andy@programming.dev 1 points 1 year ago

I'm replying here because I think yours is the right answer (etckeeper), but for other readers I want to note that for Arch Linux in particular, an alternative is aconfmgr.

[-] dotslashme@infosec.pub 9 points 1 year ago

I personally symlink/hardlink to my dotfiles repo. You can see an example of it here.

[-] Elw@lemmy.sdf.org 6 points 1 year ago

There should be no dotfiles outside of home directories so I assume you mean a config file. In those cases, git and symlinks are a great option. Make a config directory in your home dir and organize it however you want. Include config files for the tools you’re interested in, commit them to git for backups and then symlink/hardlink the file to the expected path for the application.

[-] Lily33@kbin.social 6 points 1 year ago* (last edited 1 year ago)

NixOS does that well. I never quite managed to figure out a solution to this on other distros (which is actually what led me into making the jump in the end).

[-] eshep@social.trom.tf 5 points 1 year ago

@gkpy I assume by "dotfiles" you simply mean "config files" as there should be nothing in your /etc/portage directory that's hidden. For all configs I want to backup, I just keep a copy of them elsewhere. As for portage stuff, I just copy my make.conf, and everything in each repos.conf and package.* directories.

If you want to simplify a complex solution to an already simple thing, take a look at bare git worktrees.

[-] nyan@lemmy.cafe 1 points 1 year ago* (last edited 1 year ago)

The other portage-relevant file you might want to back up is /var/lib/portage/world, which isn't even in /etc.

[-] eshep@social.trom.tf 1 points 1 year ago

@nyan Yes, always backup world if nothing else. How the hell'd I forget that!. I usually symlink it to /etc but then forget I did when updating backups. Worst case, I wind up with a slightly old world file if I need no rebuild.

[-] demesisx@programming.dev 4 points 1 year ago
[-] alternateved@lemmy.one 3 points 1 year ago* (last edited 1 year ago)

From lack of a better solution, I would symlink the folder or use stow --target /etc flag if you use stow for managing dotfiles.

[-] Raphael@lemmy.world 3 points 1 year ago

but maybe somebody knows a clever way to handle this?

backups

[-] palordrolap@kbin.social 2 points 1 year ago* (last edited 1 year ago)

Seems like an odd software choice to create actual dotfiles under /etc. Often files there have much the same name as a user's dotfiles but without the dot. Thinking of things like /etc/profile vs ~/.profile and so on.

Without knowing precisely why those decisions were taken (good reason? ignorance? insanity?) it's not clear what steps to take.

Vaguely leaning towards symlinking or hardlinking but precisely what to do and which way around is still unclear.

Do those dotfiles have your user permissions or are they owned by a system account like root?

[-] alternateved@lemmy.one 1 points 1 year ago

Those configuration files are for managing system's package manager, so I don't think $HOME would be a better place.

[-] palordrolap@kbin.social 1 points 1 year ago

Then they shouldn't have dots on them (bad design decision) and should be backed up by the system backup/restore mechanism, whatever that might be, not the user's own homedir backup, which is what I assume OP is talking about.

If they're talking about a full system backup including home directories, that's a moot point because I'd expect they'd be included anyway, dot or not.

[-] lemminer@lemmy.ml 1 points 1 year ago

Are you talking about the .keep files?

[-] eager_eagle@lemmy.world 0 points 1 year ago* (last edited 1 year ago)

Not a great solution, but my custom set of functions that synchronize the (dot)files just copy them over into a directory preserving their paths within it e.g. cp /etc/hosts ~/.sysbackups/$(hostname)/etc/hosts

[-] JubilantJaguar@lemmy.world 0 points 1 year ago

My script rewrites the paths to --etc--hosts and so on. Avoids creating a giant tree of mostly empty directories. Wish distros came with a default out-of-the-box solution for all this.

[-] eager_eagle@lemmy.world 2 points 1 year ago

right, for system files I do the minimal approach only select a handful that I wish to keep, so the tree is easy to search into. A system equivalent to $XDG_CONFIG_HOME would be nice though.

load more comments
view more: next ›
this post was submitted on 16 Jul 2023
34 points (92.5% liked)

Linux

47953 readers
1491 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS