summaryrefslogtreecommitdiffstats
path: root/scripts/watch-dir
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/watch-dir')
-rwxr-xr-xscripts/watch-dir8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/watch-dir b/scripts/watch-dir
new file mode 100755
index 0000000..4fb701f
--- /dev/null
+++ b/scripts/watch-dir
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+inotifywait -r -m "$1" -e create -e moved_to |
+ while read -r path action file; do
+ echo "The file '$file' appeared in directory '$path' via '$action'"
+ done
+
+# vim: expandtab sw=2 ts=2