Which hidden files in $HOME can be excluded from the backup and still recover desktop and application settings on restore?
I use a script with tar --create to backup $HOME and it follows with a tar --compare of the same. It got annoying that …baloo/index-lock and various .xsession-error* files always change between the create and compare. The compare always says it fails.
In the --create I put --exclude-from=$HOME/ex.txt and ex.txt has
.cache
.local
.thumbnails
.xsession-errors*
Now there are no --compare messages, and the return code says everything is fine. Joy. And the tar file is about a half gig smaller too.
I would like to add almost all $HOME/.* hidden files to the exclude list to save time and space. But which ones do I need to keep the desktop and application settings on restore?
Just to clarify - what is the reason for using a script rather than rsync?
You probably need “.local”. You probably don’t need “.cache” or the “.xsession-error*” stuff.
Many of the Plasma 5 desktop settings/data are in “.local/share”.
Very bad idea, not all applications use ~/.config/$WHATEVER/$FILE for configuration files, so you will loose those configurations.
In most cases this would mean “save a few KB/MB and maybe a few microseconds”.
Even when talking about ~/.$WHATEVER/ folders (not only ~/.$WHATEVER files) there might still be some programs using /.$WHATEVER/$configuration_files.
Except maybe ~/.cache/* and ~/.thumbnails/*, it does not really make sense to exclude any of them in order to save space/time, not even .xsession-errors (have a look at it’s size and you will see why).
(Yes, I know that .xsession-errors can be safely excluded and it will be (re)created/overwritten every time when starting a graphical session, but after all, finding the really few files that can be excluded is not really worth the effort.)
I like tidy tarballs. A tarball shows the date the backup happened. A tarball can be easily copied to another device, even to an MSDOS formatted thumb drive. A tarball can be encrypted for security. A tarball can be compressed.
Yes, rsynch can compress and encrypt. I still like one tidy file.