You are not logged in.

#1 2023-09-28 09:41:14

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Backing up my system config through Git

I've noticed with time, you can't really put all "configuration" files under 1 directory. Each application has it's own files/preferred paths. But I would like to have a failsafe in case I lose access to my system so I can get a fresh install on the same state as soon and easy as possible. Basically my idea is having git version my root dir for any relevant configuration files, but that sounds too chaotic... I'd have to manually choose files to add to the configuration versioning..

I'm sure there's a better way of doing it. Any recommendations/tools on how to approach this?

Offline

#2 2023-09-28 10:28:26

mukl
Member
From: Vienna, Austria
Registered: 2008-01-30
Posts: 55

Re: Backing up my system config through Git

https://wiki.archlinux.org/title/Dotfiles

I made a git dir ~/.dotfiles and then symlinks to the actual location

$ ln -sf .dotfiles/.bahsrc .bashrc
$ ln -sf .dotfiles/app .config/app

Of course you can make scripts for this.

Offline

#3 2023-09-28 10:30:38

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Re: Backing up my system config through Git

The problem is you have to manually pick and choose which files you want to add to the git tree (in the example you added .bashrc and an "app" folder inside .config).

But "config" files in reality are scattered around the computer. In /etc and /.config or in more places.

Offline

#4 2023-09-28 11:24:35

mukl
Member
From: Vienna, Austria
Registered: 2008-01-30
Posts: 55

Re: Backing up my system config through Git

joaomendonca wrote:

The problem is you have to manually pick and choose which files you want to add to the git tree (in the example you added .bashrc and an "app" folder inside .config).

But "config" files in reality are scattered around the computer. In /etc and /.config or in more places.

Yes, that's why I pick them manually...
How else would you tell a backup program what you want to back up?

Did you even take a look at the link I posted?

Last edited by mukl (2023-09-28 11:26:11)

Offline

#5 2023-09-28 11:33:44

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Re: Backing up my system config through Git

Edit: Reading the link above.

I understand.

My question is if there isn't a program around that might have some kind of regex/knowledge about which files are important and can just make a scan through your root folder and add those to a git tree for
you? (instead of you having to manually add them)

Last edited by joaomendonca (2023-09-28 11:36:04)

Offline

#6 2023-09-28 11:43:17

mukl
Member
From: Vienna, Austria
Registered: 2008-01-30
Posts: 55

Re: Backing up my system config through Git

Ok, i c. Sorry, I dont know any.

For system config it's easy: just back up /etc. Additionally maybe some program parses the PACSAVE files. Or create a hook for it.

For user files this will be very difficult.

Offline

#7 2023-09-28 11:45:26

joaomendonca
Member
From: Portugal
Registered: 2023-09-20
Posts: 18

Re: Backing up my system config through Git

Alright, I think I'm overthinking it too much will just take your advice on symlinks make a repo that attaches to /etc and /.config (though there's some akward dotfiles on home dir like .zshrc.... .-.) and just call it a day.

If I lose something it's because it was unimportant I guess...

Thanks a lot for the insights.

Last edited by joaomendonca (2023-09-28 11:45:44)

Offline

#8 2023-09-28 21:39:37

mikapyon
Member
Registered: 2021-03-14
Posts: 5

Re: Backing up my system config through Git

I find managing the repo manually is very educational. It forces us to look at each file, see what it does and if we want it.
After the initial setup, I find maintenance pretty low. Nothing happens unless we install, upgrade or tweak things. Git shows changes and lets us decide to keep or revert.
Better understanding helped me clean left over files from software I removed years ago.
I also use this method with more  cherry picking to quickly set up alternative users with restrictions.

Offline

Board footer

Powered by FluxBB