When backing up my system to an external drive, is it 'safe' (acceptable) to omit everything in the ~/.cache directory tree? I have perused several of the directories therein, and it appears that there are no configuration files, just cached files. But I'm not sure if I would be 'missing' any configuration or customization settings if I had to restore from backup.
Announcement
Collapse
No announcement yet.
Is it safe to omit ~/.cache in system backups?
Collapse
X
-
One should be able to clear ~/.cache at any time, with only performance affected, though some software might be upset till the next log out.
If you are doing incremental backups, particularly with btrfs, IMO it's a very good idea to not backup ~/.cache. Omitting it makes your backups faster, and one can keep many more versions into the past, a very good thing sometimes.
Chromium based browsers use $XDG_CACHE_HOME, which is normally ~/.cache, and I explicitly tell firefox where to put the cache (using the preference browser.cache.disk.parent_directory; I don't know if that's necessary); in normal web use browsers churn through GB and there's little point burdening your backups with that stuff.
With btrfs I symlink ~/.cache to /<btrfs-root>/@cache/$USER, though I imagine just making it a subvolume would do.Regards, John Little
- Top
- Bottom
Comment
-
Thank you for confirming, claydoh.
I will omit ~/.cache but keep any .cache directories that are in specific application directory hierarchies...
For now I'm just using rsync. But I see that there is a Timeshift backup application that I will investigate once I have my system in a nominal state. When I still had my iMac, I had 2 external backup drives (I'm cautious, thus 2 backup devices ), I formatted them usin EXT4 file system. So, when I installed kubuntu, I just copied all my files to my internal SSD. Easy.
- Top
- Bottom
Comment
-
I use rsync as my backup solution, to USB plugged in drives, of /home and /opt. I don't skip cache, and it doesn't matter to me about the time it takes to copy a whole raft of small files. That's just a personal decision. Timeshift is cool, and there are a bunch of rsync-based GUI apps that will do the same thing and are generally very configurable. When using rsync, I use the verbose option. On occasion, very rarely, an error will occur, and it's nice to observe whether it goes all the way to the end, or if it stops on error.The next brick house on the left
Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11| Kubuntu 24.04 | 6.8.0-31-generic
- Top
- Bottom
Comment
-
If you use --delete with your rsync, the backup won't fill up with cache files; but if you use Timeshift or some similar tool, they might, or the tool will have to start pruning older data. I like having a history of files going back years; though in principle the tool for that is a version control system.Regards, John Little
- Top
- Bottom
Comment
-
Thanks for the replies, gents....
jlittle, I have not yet even installed Timeshift but I will play with it and see how I like it. I will also try out other such tools with GUIs... a good experience to get more familiar now that I'm on kubuntu.
jglen490, I do the same, rsync to 2 external USB Western Digital drives (redundant external drives). I do have plenty of space so I could backup .cache without issues.
At least I have rsync working, so at least now I can relax and get down to using my system.
- Top
- Bottom
Comment
Comment