Skip to main content

Crate prune_backup

Crate prune_backup 

Source

Structs§

FileInfo
RetentionConfig
RetentionFileConfig
Configuration read from a .retention file in TOML format. All fields are optional; missing fields will use CLI args or defaults.

Enums§

RetentionReason
Reason why a file was kept by the retention policy.

Constants§

RETENTION_FILE_NAME
The name of the retention configuration file.

Functions§

get_file_creation_time
Gets the modification time of a file, falling back to creation time.
move_to_trash
Moves a file to the system trash, or uses a custom command if provided.
read_retention_file
Reads a .retention file from the given directory.
resolve_config
Resolves the final retention configuration from CLI args and file config.
rotate_files
Rotates files in a directory based on retention policies.
scan_files
Scans a directory for files and returns them sorted by creation time (newest first).
select_files_to_keep
select_files_to_keep_with_datetime
select_files_to_keep_with_reasons
Selects files to keep with reasons, using a specific datetime as “now”.