Home directory regenesis

When some unexpected event occurs on my computer, I may begin by troubleshooting in the home directory. Lately, I was having several program loadings that were taking a good deal of time that explanation thereof was baffling—a resolution I was unfortunately not able to find an answer for. The realistic solution for me was to create a new user and copy the trusted files over to a new home folder. It turned out to be a fairly easy thing to do.

The quick and the darned

In the past methodically I would clean out my home directory. I did this every year or twice a year. I did this because usually a quirk developed here or there but also because I’m a type A personality. Why quirks occur can be of one of several reasons but it might be related to a program’s configuration files: like with the addition of a new feature to a program, or with an older setting interfering with a new feature, databases getting too large…

I have much respect for my configurations and I do my best to keep them. The methodology I have learned of how to interact with my programs I respect and try to keep around and develop. However, at times, configuration renewal may become necessary. I do this only when I have to.

All work and no play is OK

Business if more important when I come down to it. Going through all the files, is no doubt, a laborious process, however, the result is worth it when everything is again running correctly.

First, I create a new user:

# useradd --gid users --groups games,wheel --shell "/bin/bash" USERNAME 
# install --directory --owner=USERNAME --group=users --mode=700 /home/USERNAME
# passwd USERNAME

I then put all the directories and trusted configurations in a list:

.local/share/applications/
.local/share/gedit/styles/autumnal.xml
Audio
Desktop
Development
Documents
Downloads
Pictures
Public
Videos

Then transfer them using rsync:

rsync --archive --files-from=include.txt --exclude-from=exclude.txt /home/USERNAME-OLD/ /home/USERNAME-NEW/

Since both users are in the same initial group (users), I just need to change user ownership from the old own to the new and then I’m done:

find /home/USERNAME-NEW/ -user USERNAME-OLD -exec chown USERNAME-NEW {} \;

This process took me about an hour.