1

I have recently discovered that my ~/.cache/thumbnails/normal/ folder contains some very old thumbnails. I was under the impression that these were automatically deleted with reasonable frequency. The contents of this folder suggests that I am wrong. I had a similar issue in Ubuntu 18.04 with GNOME and was under the impression that this was a Nautilus issue. However, having this same issue on Xubuntu 20.04 with Thunar suggests that I need to look elsewhere.

Are the deletion rules for the files in ~/.cache/thumbnails/ somewhere that I can easily access and change? Furthermore, is this an Ubuntu issue or have I simply had the misfortune of using two DEs with an identical issue?

J. Mini
  • 138
  • 1
  • 4
  • 22

1 Answers1

1

It would appear that the only rule is that if you delete an image file from within thunar, the associated thumbnail file is also removed. However, if you delete it from the command-line or another file manager, it is not deleted and will just stay there.

It might be a good idea to prune automatically from the cache old thumbnail files. Even if you remove valid thumbnail files, they will be created anew when needed.

The tool to use is cron. For example, create a new file in the /etc/cron.d folder with the following contents:

0 21 * * * root find /home/*/.thumbnails/ -type f -atime +6 -exec rm '{}' \;

This cron-job will run as root at 9PM (21h), find all the thumbnail files in all home-folders and delete the ones that have not been accessed during the last 7 days (today +6 days).

If you rather wish to disable thumbnails, go to the menu Edit > Preferences > Display and set "Show Thumbnails" to Never.

For strong measures, you could also do:

cd ~/.cache
mv thumbnails xthumbnails
ln -s thumbnails /dev/null
harrymc
  • 455,459
  • 31
  • 526
  • 924
  • This is a great alternative to what I'm looking for, but what about the question of where Thunar keeps its rules? Is there any way that the user can customize them? Or is the method mentioned in your first paragraph the only thing that Thunar allows? A source for where you get any answer to that would also be a great read. – J. Mini Dec 01 '21 at 21:12
  • I have surveyed several posts for possible solutions. No one ever mentioned a rule database, but many have said the same, so it seems this behavior is programmed into thunar. I can't give any one authoritative source, as I cobbled together several of them. – harrymc Dec 01 '21 at 21:18