All languages

C

You're viewing a free preview. Sign in free to read every script.

Why this exists "What is eating the disk?" and "delete logs older than 30 days" are the two most common housekeeping jobs on any server. Both need the same skill: walk a directory tree, look at each entry, and act on…

Walking a Directory Tree: scandir, lstat, Symlinks and a Disk-Usage and Old-File Report

Recurse through a directory with scandir and lstat, tell files, directories and symlinks apart, total the bytes, rank the largest files and find files older than N days, the core of every cleanup and disk-usage tool.

Sign in free to read this script, along with the rest of the library.

Sign in free