Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Coming from Windows, as you might've guessed. Now I'm trying to compile my first-ever post-install bash script for Pop OS LTS 20.04. Questions along the way... pls bear with me:
# Where does Linux store configuration/setting files for various custom apps?
I've made a number of modifications to the following apps and now want to save config files for future re-installs or include the changes to my script. After some research, I've identified /home/.config directory as my #1 candidate for being the right spot for what I'm looking for but is it the only one?
I heard about the native rsync tool, as well as the apps Aptik and Mackup for backing-up and restoring Linux systems but are they helpful in my case, which is backing up only the config files, not the entire system?
Apps I've added to my system so far:
Audacity
Bleachbit
Brave browser
Calibre
ClamAV
Clementine
Gufw firewall
GNOME Tweaks
Inkscape
KeepassXC
LibreOffice 7.0
Stacer
VLC
WinRAR
PLUS changes to folder settings, GNOME and the system itself, etc...
# Can you please hint me a comprehensive resource where I can learn about adding changes in the config files to my bash script for future reference?
My goal is to automate both the re-installation of actual apps and adding/modifying their config files in the post-install stage. Like opening the config file, adding/modifying the necessary line and saving it after the app is installed.
I can't recommend a comprehensive list or resource, you seem to be making one by creating your list of where configurations are saved on a per application basis.
The pure static test is to restart clean for each one and ensure that the saved configuration you have, gets restored correctly. Another thing would be to check the modification dates for files.
Distribution: Ubuntu based stuff for the most part
Posts: 1,173
Rep:
You are on the right track, .config will have most user settings. Instead of manually adding files to your backup, why not just backup everything in your $HOME and then just list any directories or files to ignore?
rsync and any of the tools built on top of it can he used to backup whatever files or directories you point it to. The first time you run it, everything will be backed up, then on subsequent runs only the changes.
Surely you are going to backup your personal files? If you do, then (as has been said) your configuration gets done a the same time. Of course, a general backup of $HOME does save a lot of browser history, thumbnails, and the like, but it's no real problem.
System-wide settings are in /etc
User-wide settings will be in "hidden" directories or files and these all begin with a 'dot'.
You will get thousands of files - but they are all very small.
There is no special tool that only deals in config info.
However, if you just backup /etc & all hidden files, these will include all config files.
You will also be including some non-config files -if you have a non-empty 'Trash' bin, this could be considerable.
Your Trash can be found in ~/.local/share/Trash, for example and ~/.cache/ contains an amazing amount of stuff.
Note that if you uninstall a package with the purge option, it will purge the system-wide config files in /etc, but not any user specific configuration.
I would expect the situation with these so-called "package managers" to be much more complicated - which is why I don't use them.
I just back up my /home directory, including the hidden files, on a daily basis and all I need to do is restore that backup, and all the settings are included. The one hidden directory you don't need to back up is .cache. That's a waste of space and time.
The more I live, the more I learn... Thank you, guys, indeed your tips are helpful!!!
I found another two tips (actually, links) that can help with restoring the system and user settings right after a fresh Linux install. You may find'em useful too, the keyword being 'dotfiles':
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.