1 unstable release
Uses old Rust 2015
| 0.1.0 | Apr 16, 2018 |
|---|
#9 in #logrotate
12KB
275 lines
logrustate
logrotate reimplementation using inotify for event based log rotation
Usage
Simply point logrustate at your logs using the following invocation:
logrustate -f ONE_LOG_FILE -f ANOTHER_LOG_FILE -f AND_ANOTHER -s SIZE_OF_PRESERVED_LOGS -n NUMBER_OF_OLD_LOGS
Two important notes:
- Logs are
mmaped to the process's address space and chunks of sizeSIZE_OF_PRESERVED_LOGSare taken off of the top while the remaining data is pushed to the beginning of the file usingfallocate. This absolutely requiresO_APPENDopened log files or there will be undefined behavior and potential data loss otherwise. This is usually how logs are opened but make sure you are using this option for your logs files before using this tool. - Due to limitations in the
fallocatesyscall, log size must be a multiple of 4096.
Dependencies
~2.2–4.5MB
~89K SLoC