Skip to content

Rotates a file while keeping the last N lines from the existing log in the new log file.

License

Notifications You must be signed in to change notification settings

jemminger/tailing_log_rotator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TailingLogRotator
=================

Allows rotation of a log file while keeping its last NNN lines in the new log
file.

Arguments:
  log_file_path       full path to the log file to rotate

  lines_to_preserve   how many lines from the existing log file to leave in the
                      newly rotated file

Options:
  :hup                the name of the program to send a "killall -HUP" to after
                      rotation

Example
=======

TailingLogRotator.rotate('/var/log/maillog', 2_000_000, :hup => 'syslogd')


Copyright (c) 2011 [Jeff Emminger], released under the MIT license

About

Rotates a file while keeping the last N lines from the existing log in the new log file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages