Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.

ggrandes/logrotate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

logrotate

Log Rotate based on filesize with Timestamp of lines, open source C code (Apache License, Version 2.0). Do not require any external code/lib.


How works:

Read from stdin and output lines with timestamp in an output file (pathname), rotating them when file size exceeds specified size in bytes.

Compile (handmade)

gcc -Wall -O2 logrotate.c -o logrotate

Running

./process-to-log | ./logrotate <pathname> <size-limit-bytes>

Example output file:

2013-06-02 00:47:51 > Lorem ipsum dolor sit amet, consectetur adipiscing elit.
2013-06-02 00:47:51 > Pellentesque in mi ac tellus porttitor condimentum.

Inspired in rotatelogs and cronolog, this is C-minimalistic version.

About

Log Rotate based on filesize with Timestamp of lines

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages