Ludus Packer Cache Cleanup Guide
Description
This PR provides a guide for implementing time-based file rotation for Packer cache ISO files. The proposal addresses the issue of ISO files and lock files accumulating in /opt/ludus/users/USERNAME/packer/packer_cache
over time, consuming significant disk space.
Solution Overview
The guide outlines multiple approaches to implement automatic cleanup:
- Using a dedicated time-based file rotation tool (Rotafile with example provided)
- Using standard Linux tools (
find
with cron) - Suggestions for various retention policies (30-day, 60-day, etc.)
Benefits
- Reduces disk usage by automatically removing old ISO files
- Prevents Packer cache from growing indefinitely
- Provides options for both manual and automated cleanup
- Includes logging capabilities for audit purposes
Implementation Details
- No code changes required to Ludus core
- Can be implemented as a standalone maintenance solution
- Fully configurable retention periods
- Could be integrated with Ludus CLI in the future if desired
Testing
I've tested both approaches (Rotafile and standard find
commands) on a system with similar directory structure, and both successfully identified and removed files based on age criteria.
The solution is designed to be non-invasive and can be adjusted to meet specific needs of Ludus installations with different usage patterns.
Issue ref: #97 (closed)