rotatee
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
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