journal

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleanup

type Cleanup struct {
	// contains filtered or unexported fields
}

Cleanup implements garbage collection for systemd journals

func New

func New(config Config) (*Cleanup, error)

New creates a new journal log directory vacuum cleaner

func (*Cleanup) Prune

func (r *Cleanup) Prune(context.Context) (err error)

Prune removes the unused journal log directories. It determines whether the directory is eligible for removal by matching against the configured active machine ID and removing directories that do not match.

type Config

type Config struct {
	// Config specifies the common pruner configuration
	prune.Config
	// LogDir optionally specifies the directory with journal log files.
	// If unspecified, defaults to defaults.SystemdLogDir
	LogDir string
	// MachineIDFile optionally specifies the file to read the machine ID.
	// Machine ID is used to tell between active and redundant log directories.
	// If unspecified, defaults to defaults.SystemdMachineIDFile
	MachineIDFile string
}

Config defines the configuration for the cleaner of obsolete journal files/directories

Jump to

Keyboard shortcuts

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