Skip to content

Commit

Permalink
packaging: add debian scripts and manpage
Browse files Browse the repository at this point in the history
  • Loading branch information
anti-spin committed Dec 6, 2024
1 parent 4eada0a commit 5e8a900
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
9 changes: 9 additions & 0 deletions debian/control.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: ringlog
Version: @VERSION@
Section: utils
Priority: optional
Architecture: amd64
Maintainer: Andi Hechtbauer <[email protected]>
Description: pipe-friendly utility to manage log files by capping size or line count
Installed-Size: 2200237
Depends: libc6 (>= 2.31), systemd
10 changes: 10 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# postinst script for ringlog

# Install the man page
if [ -f debian/ringlog.1 ]; then
install -m 644 debian/ringlog.1 /usr/share/man/man1/ringlog.1
mandb -q || true
fi

exit 0
39 changes: 39 additions & 0 deletions debian/ringlog.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.TH RINGLOG 1 "December 2024" "ringlog 1.0" "User Commands"
.SH NAME
ringlog – pipe-friendly utility to manage log files by capping size or line count.

.SH SYNOPSIS
.B ringlog
.RI [ options ]

.SH DESCRIPTION
.B ringlog
is a utility designed to cap log file size or line count while being pipe-friendly. It reads input from stdin and writes to a specified log file, ensuring the log does not grow beyond a defined size or number of lines.

.SH OPTIONS
.TP
.B \-s <max_size_bytes>
Maximum size of the log file in bytes.
.TP
.B \-l <max_lines>
Maximum number of lines in the log file.
.TP
.B \-f <log_file>
Path to the log file where the input will be appended.
.TP
.B \-v
Enable verbose output. Prints information about log actions to stderr.

.SH USAGE
.B ringlog
is primarily used to cap log output from scripts or cron jobs to ensure log files remain manageable.

Example usage:

.nf
./my_script.sh | ringlog -l 1000 -f /var/log/my_log.log
.fi

.SH AUTHOR Written by anti-spin.

.SH LICENSE MIT License.

0 comments on commit 5e8a900

Please sign in to comment.