Originally published October 21, 2018 @ 6:19 pm
When you get a filesystem space alert (and they tend to arrive at 3:37 on Saturday morning), deleting various supersized log files is one option I already covered in adequate detail. That is if you get so lucky as to find such a file to delete…
On occasion, the out-of-space situation is like a death by a thousand paper cuts – folders filled with a large number of small files. This little script here fill look for folders matching “log(s)” or “t(e)mp” that are greater than 200MB in size (you can easily adjust these parameters).
To install:
d=/var/adm/bin f=large_folders.sh mkdir -p ${d} wget --no-check-certificate -O ${d}/${f} https://raw.githubusercontent.com/igoros777/kw/master/large_folders.sh chmod 755 ${d}/${f} ln -s ${d}/${f} /usr/bin/large-folders
The syntax is simple:
large-folders [directory] [depth]
If you don’t specify the directory name, the script will search all mounted local filesystems.
Experienced Unix/Linux System Administrator with 20-year background in Systems Analysis, Problem Resolution and Engineering Application Support in a large distributed Unix and Windows server environment. Strong problem determination skills. Good knowledge of networking, remote diagnostic techniques, firewalls and network security. Extensive experience with engineering application and database servers, high-availability systems, high-performance computing clusters, and process automation.