https://github.com/msantos/rotatee
tee(1) with file rotation
https://github.com/msantos/rotatee
tee
Last synced: 6 months ago
JSON representation
tee(1) with file rotation
- Host: GitHub
- URL: https://github.com/msantos/rotatee
- Owner: msantos
- License: isc
- Created: 2024-04-29T11:06:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-28T11:42:34.000Z (about 1 year ago)
- Last Synced: 2025-02-13T05:30:07.730Z (8 months ago)
- Topics: tee
- Language: Go
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SYNOPSIS
rotatee [*options*] [*file prefix*]
# DESCRIPTION
`rotatee` is `tee(1)` with file rotation:
* stdin is written to stdout
* stdin is also written to a file with a timestamp
* if the next line of input exceeds the maximum configured number of
bytes, the input is written to a new file
* if SIGTERM is received, `rotatee` will exit after writing the next
line of input# BUILDING
```
go install codeberg.org/msantos/rotatee/cmd/rotatee@latest
```## Source
To build a reproducible executable from the git repository:
```
CGO_ENABLED=0 go build -trimpath -ldflags "-w" ./cmd/rotatee
```# EXAMPLES
```
# writes output to files in the current directory prefixed with "stdout"
rotatee# writes output to files in /tmp prefixed with "output"
rotatee --dir=/tmp output
```# SIGNALS
SIGHUP
: rotate log fileSIGTERM
: write next line of input and exit (use `--ignore` to disable)# OPTIONS
dir *string*
: output directory (default ".")format *string*
: timestamp format (default "2006-01-02T15:04:05Z07:00.log")ignore
: ignore SIGTERMmaxsize *int*
: max file size (MiB) (default 100)output-error *string*
: set behavior on write error (sigpipe, warn, warn-nopipe, exit, exit-nopipe) (default "sigpipe")* warn: diagnose errors writing to any output
* warn-nopipe: diagnose errors writing to any output not a pipe
* exit: exit on error writing to any output
* exit-nopipe: exit on error writing to any output not a pipe
* sigpipe: exit on any error writing to a pipe, diagnose errors writing
to any output not a pipe
* ignore: suppress and do not exit on errors