Go for DevOps
You're viewing a free preview. Sign in free to read every script.
Why this exists Cleanup tools delete files, so the design matters more than the code: dry run by default, refusal to run on system directories, and a clear report. Go's standard library makes the walking and time…
Log Cleanup Tool: Walking Directories, Dry Run and Safety Guards
A file-cleanup tool that walks a directory tree with filepath.WalkDir, finds files older than a cutoff, reports the space involved, and deletes only when asked. Includes guards against running on dangerous paths.
Sign in free to read this script, along with the rest of the library.
Sign in free