Structs§
- File
Info - Retention
Config - Retention
File Config - Configuration read from a
.retentionfile in TOML format. All fields are optional; missing fields will use CLI args or defaults.
Enums§
- Retention
Reason - 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
.retentionfile 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”.