rotatee

command module
v0.0.0-...-9ce34b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2017 License: MIT Imports: 11 Imported by: 0

README

rotatee

Build Status Go Report Card Coverage Status

rotatee is a simple program that works like tee with some extension:

  • rotatee copies input to output file(s) with rotation.
  • Multiple rotation methods supported
    • size-based
    • period-based

rotatee is inspired by some popular programs such as

Install

TBD

Options

See rotatee --help.

Examples

Like tee:

$ echo 'hoge' | rotatee hoge.txt

Rolling period is guessed from the format:

$ for i in `seq 1 3`; do echo 'hoge'; sleep 1; done | rotatee /tmp/hoge-%S.log
hoge
hoge
hoge
$ ls /tmp/ | grep hoge
hoge-10.log
hoge-11.log
hoge-12.log
hoge-13.log

Size-based rolling:

$ echo "abcdefg" | ./rotatee --size 3B --history 10 /tmp/size%i.log
abcdefg
$ cat /tmp/size2.log /tmp/size1.log /tmp/size.log
abcdefg

TODO

  • Add more test cases
  • Rolling with archive

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL