I am new to Raspberry Pi and Raspbian. Just curious, can I delete the
What is its purpose?
Can I automate the deletion process for this folder? What's the command/scripts that I can use to auto-delete it once a week?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
You can learn a lot more, and with a smaller investment in time, by simply "Googling" for information on what the cache is, and how it's used in modern *nix systems. For example, the following search term in Google yields numerous results that may help you:
linux purpose of .cache.
With that out of the way, I'd answer your questions as follows:
What is the purpose of
~/.cache?: The purpose of the ~/.cache is to provide a common area in which applications can store information that may be needed in the future. By storing this information in the cache, the application may be able to do its job more quickly and efficiently. This may save you time, and make more effective use of your RPi's resources.
Can I delete the folder? If you have the requisite privileges, then, "Yes, you can delete the folder." Perhaps a better question is, "Should I delete the folder?" For me, the answer is generally "No". Why? Because I don't feel the need to delete things simply to free resources that I may or may not need. If I had reason to believe or suspect that an application was misusing the cache, then I certainly would delete it (and probably delete the application as well!).
3.a. Can I automate the deletion process for this folder? Yes, you can automate it in one or more ways.
3.b. What's the command/scripts that I can use to auto-delete it once a week? I would use
cron for that job. To employ
cron, you only need to add a line to your
crontab file. You can learn more about using
cron through a Google search, and by typing
man cron and
man crontab at the command line. Try this, and if you have specific questions, let us know.
bleachbit --clean system.cacheat whatever time you wish.
Description: delete unnecessary files from the system BleachBit deletes unnecessary files to free valuable disk space, maintain privacy, and remove junk. It removes cache, Internet history, temporary files, cookies, and broken shortcuts.
It handles cleaning of Adobe Reader, Bash, Beagle, Epiphany, Firefox, Flash, GIMP, Google Earth, Java, KDE, OpenOffice.org, Opera, RealPlayer, rpmbuild, Second Life Viewer, VIM, XChat, and more.
Beyond simply erasing junk files, BleachBit wipes free disk space (to hide previously deleted files for privacy and to improve compression of images), vacuums Firefox databases (to improve performance without deleting data), and securely shreds arbitrary files. Homepage: https://www.bleachbit.org/