1
0
Fork
You've already forked rotatee
0
tee(1) with file rotation
  • Go 100%
2025年11月26日 07:37:29 -05:00
cmd/rotatee 0.2.2 2025年11月26日 07:37:29 -05:00
.gitignore .gitignore: ignore compiled executable 2024年09月27日 07:17:26 -04:00
go.mod build: use vanity URL 2025年11月25日 07:28:19 -05:00
LICENSE doc: add LICENSE 2024年09月28日 07:42:08 -04:00
README.md build: use vanity URL 2025年11月25日 07:28:19 -05:00

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 go.iscode.ca/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 file
SIGTERM
write next line of input and exit (use --ignore to disable)

OPTIONS

dir string
output directory (default ".")
format string
timestamp format (default "2006年01月02日T15:04:05Z07:00.log")
ignore
ignore SIGTERM
maxsize 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