maintenance

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 7 Imported by: 0

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

func GetDiskUsage() (DiskUsage, error)

GetDiskUsage returns current disk utilisation for the root filesystem ("/").

type ScheduleStatus

type ScheduleStatus struct {
	Enabled  bool
	Platform string
	Detail   string
}

ScheduleStatus reports the current state of the daily timer.

func GetScheduleStatus

func GetScheduleStatus() ScheduleStatus

GetScheduleStatus returns the current status of the daily cleanup timer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL