/cont-append

Continuous data appender; can be used for safe log retention.

Primary LanguageRustMozilla Public License 2.0MPL-2.0

cont-append

Continuous data appender; can be used for safe log retention.

Note that this is not meant to watch extremely large directories due to constraints like the inotify watch limit, which can be tweaked in the operating system.

We may add an option to use a polling based watcher in various capacities. It could be run in addition to the inotify-based watcher at some interval to avoid missed events, or it could be used instead of the inotify watcher in cases where inotify is not suitable.

Algorithm Overview

  1. Given a directory
  2. Watch for events recursively in the directory
  3. If the event is Create, (re)initiate tail on the file. That is, if we're already tailing, kill the old tail and start a new one. TODO: (Is this necessary after fixing tail)?
  4. If there is a Delete, stop the tail.
  5. Otherwise, presmuably we have appended data to the file, and let tail do its thing.