You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux stores lots of cache files I don't give a damn about that take up many GBs of space. Today, I just reclaimed over 23 GB of space from just deleting one user's ~/.cache/ directories.
The issue arises that rm is not very safe and is very unwieldly when it comes to excluding patterns of files/directories I want to keep, while also having various race conditions of not deleting files added once the process starts.
To get past this, I wanted to use rsync, but it has no ability to JUST delete files. You have to copy them somewhere, first.
The Solution
Enter nullfsvfs:
This is what I now have in my /etc/cron.daily/clean-cache:
The Problem
Linux stores lots of cache files I don't give a damn about that take up many GBs of space. Today, I just reclaimed over 23 GB of space from just deleting one user's
~/.cache/
directories.The issue arises that
rm
is not very safe and is very unwieldly when it comes to excluding patterns of files/directories I want to keep, while also having various race conditions of not deleting files added once the process starts.To get past this, I wanted to use
rsync
, but it has no ability to JUST delete files. You have to copy them somewhere, first.The Solution
Enter
nullfsvfs
:This is what I now have in my
/etc/cron.daily/clean-cache
:Update: I have officially released this as part of my BashScripts collection:
https://github.com/hopeseekr/BashScripts/blob/master/cron.daily/00_clear-cache
The text was updated successfully, but these errors were encountered: