Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallDailyTimer ¶
func InstallDailyTimer() error
InstallDailyTimer installs a system-level timer that runs disk-cleanup every day at 03:00 local time. On Linux it writes systemd unit files; on macOS it writes a LaunchDaemon plist. Returns an error if the required privileges are not available.
func RemoveDailyTimer ¶
func RemoveDailyTimer() error
RemoveDailyTimer uninstalls the daily timer installed by InstallDailyTimer.
Types ¶
type CleanupResult ¶
type CleanupResult struct {
Before DiskUsage
After DiskUsage
DockerPruneOut string
LogRotationOut string
JournalVacuumOut string
Errors []error
}
CleanupResult summarises what disk-cleanup did.
func DiskCleanup ¶
func DiskCleanup() CleanupResult
DiskCleanup runs all three cleanup steps and returns a summary. It never aborts early — it collects all errors and reports at the end.
type DiskUsage ¶
type DiskUsage struct {
// UsedPercent is the percentage of the disk that is in use (0-100).
UsedPercent int
// TotalGB is the total disk capacity in gigabytes.
TotalGB float64
// UsedGB is the used disk space in gigabytes.
UsedGB float64
// FreeGB is the free disk space in gigabytes.
FreeGB float64
}
DiskUsage holds before/after disk utilisation for a cleanup run.
func GetDiskUsage ¶
GetDiskUsage returns current disk utilisation for the root filesystem ("/").
type ScheduleStatus ¶
ScheduleStatus reports the current state of the daily timer.
func GetScheduleStatus ¶
func GetScheduleStatus() ScheduleStatus
GetScheduleStatus returns the current status of the daily cleanup timer.