Logrotate - Unique Fork Written in Rust
Taking inspiration from the Linux tool: https://linux.die.net/man/8/logrotate
Intent:
Slim version of a logrotate cli utility for: archiving, removing, and truncating files in a provided directory.
Usage:
logrotate --help
Cli tool for rotating files within specified directory.
Usage: logrotate [OPTIONS] --archive-method <ARCHIVE_METHOD> --directory <DIRECTORY> --keep-days <DAYS>
Options:
--dry-run
Perform a dry run without making any changes Will output files marked for deletion, archival, and truncation
-a, --archive-method <ARCHIVE_METHOD>
Archival method to use [possible values: tar, tar-gunzip, zip]
-d, --directory <DIRECTORY>
Directory to parse through
-k, --keep-days <DAYS>
Number of days to keep archived files [default: 7]
-h, --help
Print help
-V, --version
Print version
Support:
| File Extension | Supported | Planned |
|---|---|---|
| log / logs | ✅ | - |
| txt / text | ✅ | - |
| bin | ❌ | ❌ |
| xml | ✅ | - |
| csv | ✅ | - |
| json | ✅ | - |
| elf | ❌ | ❌ |
| cef | ✅ | - |
| clf | ✅ | - |
| syslog | ✅ | - |
| Any Unnamed Extension | ❌ | ❓ |
Build Locally:
Requires Rust (minimum stable-2024 & any-architecture)
Built binary is ~2Mb on disk
Install Prebuilt:
Brew (MacOS):
Linux (Fedora / CentOS / RHEL / Rocky - dnf or yum | x86-64, aarch64, ppc64le):
Linux (Debian - apt | x86-64, aarch64):
Windows (x86-64 assumed):
Crates.io