Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 1.91 KB

README.md

File metadata and controls

72 lines (48 loc) · 1.91 KB

logrustate

A modern, drop-in replacement for logrotate — written in Rust.

Crates.io License: MIT Build GitHub Release

logrustate /etc/logrustate.toml --verbose

Why logrustate?

logrotate has been the de-facto log rotation tool on Linux since 1996. It works — but it was written in C, relies on crond, has a confusing config format, no dry-run mode, and cryptic errors.

logrustate is a modern replacement with a clean TOML config, verbose output, proper dry-run, and full compatibility with legacy logrotate.conf syntax.


Installation

⚡ Quick Install (Linux / macOS)

curl -fsSL https://raw.githubusercontent.com/anilcan-kara/logrustate/master/install.sh | sh

Cargo

cargo install logrustate

Quick Start

Create a TOML config

# /etc/logrustate.toml

[[logs]]
path = "/var/log/nginx/access.log"
rotate = 7          # keep 7 rotated files
compress = true     # gzip after rotation
daily = true        # rotate daily
missingok = true    # don't error if file is missing
notifempty = true   # skip rotation if log is empty

Preview without changes (dry-run)

logrustate /etc/logrustate.toml --debug

Contributing

See CONTRIBUTING.md. All PRs welcome.


License

MIT © Anilcan Kara