https://github.com/urin/dtail
Bash script to watch contents of files using inotify
https://github.com/urin/dtail
bash tail
Last synced: 12 months ago
JSON representation
Bash script to watch contents of files using inotify
- Host: GitHub
- URL: https://github.com/urin/dtail
- Owner: urin
- License: mit
- Created: 2019-05-20T23:58:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-06-28T08:35:29.000Z (12 months ago)
- Last Synced: 2025-06-28T09:37:47.944Z (12 months ago)
- Topics: bash, tail
- Language: Shell
- Homepage: https://github.com/urin/dtail
- Size: 9.77 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
dtail - Bash script to watch contents of files using inotify
===
## Overview
`dtail` is a simple bash script to watch contents of file in directories using [inotify\-tools](//github.com/rvoicilas/inotify-tools/wiki) and `tail`.
You can watch any files even if they are newly created in directories.
## Description
`dtail` watches all files and directories trapping events CREATE, MODIFY and DELETE.
`dtail` creates a `tail` process for each watching file and has a process pool that is a list of `tail` processes.
When CREATE and MODIFY event of a file that is not monitored by `dtail` is fired, `dtail` starts background `tail` process and adds it to the process pool. If the pool is full, the oldest process is deleted from the pool and the tail process is killed.
The pool size, that is the maximum number of background `tail` processes, can be specified by user.
Event of a directory or file without reading permission is ignored.
## Requirement
- bash 3.1+
- inotify-tools 3.7+
## Usage
```
Usage: dtail [options] [--] path...
Options:
-r|--recursive
Watch subdirectories recursively.
--exclude | --excludei
Exclude files if filename matches (POSIX extended regular expression).
It is case insensitive with --excludei.
--fromfile
Read filenames to watch or exclude from a file, one filename per line.
If filenames begin with @ they are excluded as described above.
-p|--poolsize
Maximum number of watching processes. Default 1.
```
## License
[MIT](/LICENSE)
## Author
[urin](//github.com/urin)