-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathinotify-debug.sh
More file actions
executable file
·32 lines (26 loc) · 843 Bytes
/
Copy pathinotify-debug.sh
File metadata and controls
executable file
·32 lines (26 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
trap 'echo "[ERROR] Error in line $LINENO when executing: $BASH_COMMAND"' ERR
if ! command -v inotifywait || ! command -v s6wrap; then
apt update
apt install --no-install-recommends -y inotify-tools gcc libc6-dev make git
cd /tmp
rm -rf /tmp/s6wrap
git clone https://github.com/wiedehopf/s6wrap
cd s6wrap
make
cp -f s6wrap /usr/local/bin/
fi
pkill inotifywait || true
rm -f /run/inotify.log
echo 192000 > /proc/sys/fs/inotify/max_user_watches
s6wrap --timestamps --args inotifywait -r -m /etc /opt /root /home /usr /lib /boot /var \
| grep --line-buffered -F -v -e OPEN -e NOWRITE -e ACCESS -e /exclude_dir1 -e /exclude_dir2 \
>/run/inotify.log 2>&1 &
disown
echo
echo
echo "to view writes, use: tail -f -n 200 /run/inotify.log"
echo "to kill, use: pkill inotifywait"
echo
echo