Hey there,
im a not very advanced Linux (and GitHub) user and went through the process to sucessfully backing up my dotfiles.
Currently
I take the files (somewhere in my home-folder) and cut/paste them into my local github dotfiles-repository
I execute a self-created script to automatically create symlinks from these files to the destination where they came from
Than i can change these files and commit it to my private repository
→ So far nothing new due to the fact that this seems very common (and is working fine) as seen in several tutorials
Thinking about …
… also backing up other files from my system which are not placed in the home-folder e.g. like my nvidia-x-server settings file placed at /etc/X11/xorg.conf.d/20-nvidia.conf
I think its not a good idea to cut/paste such files which should only be managed by root-user and shift them to some users home directory
→ Am i right?
Possibilities?
Creating a script which does not symlink, but simply copy the relevant files (with folderstructure) into a local github dotfiles-repository before comitting CON: Redundant files; Danger of accitently configuring copy-files and not source-files; Danger of breaking my system because i don’t know what im doing PRO: System files stay inside the folders as it sould be (including permissions etc.?); Less chance to break the system
There is no need / its not good practice to backup particular system-files like this
I was just thinking about this, could not find something by searching the web / this board so maybe someone can give me a good advice.
What about using a real [backup](https://wiki.archlinux.de/title/Backups) solution instead of a git-file ?
I do use snapshots (with btrfs and snapper)
There is timeline
or backuppc
When using automatic snapshots, it is not only possible to do a complete rollback, but as you do with the git-files it is possible to access every single file in every snapshot
Snapshots can be used with any single partition/mountpoint. You don´t have to use them allover. (I do have separate snapshots of / and /home )
I have been experimenting with three approaches - all of which can copy (sync) instead of (in addition to) symlinks (sort of).
The first one I used was the bare git approach (How to store dotfiles | Atlassian Git Tutorial) but applied to my root file system. It worked ok, but I didn’t like it for some reason. Mostly that it was hard to see what was being tracked.
The second was to use dotdrop (dotdrop). This tool can diff the changes. But I found that for my personal dotfiles I also had a hard time seeing what was in git and what wasn’t without symlinks. It can do symlinks and a whole lot more, but its sync first and symlink second as far as paradigms goes. It was also a bit slow.
So, at the moment I have fallen back to my favorite which is dotbot (GitHub - anishathalye/dotbot: A tool that bootstraps your dotfiles ⚡️). I am currently using it to symlink my home dotfiles, but it has a plug-in for rsync (which I haven’t tried yet) that I plan on using to keep my system config files in sync with. I did like dotdrops diff tool though, so that might be a something that sends me back to #2 when I get around to testing this part out.
Sorry, the second link is wrong: dotdrop. Dotdrop by default copies between your git repo and a location. It also has capabilities to diff between the two and install, import, or update the files.