Skip to content

Instantly share code, notes, and snippets.

@gene1wood
Created May 10, 2020 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gene1wood/286c02b9894b5fa4276e66a7f3101bf3 to your computer and use it in GitHub Desktop.
Save gene1wood/286c02b9894b5fa4276e66a7f3101bf3 to your computer and use it in GitHub Desktop.
Script to create inotifywait on directories to trigger Subsonic media scanning
#!/bin/bash
dirs="/path/to/first/dir /path/to/second/dir /path/to/third/dir"
act="/usr/local/bin/act-on-new-media.bash"
# act="cat"
/bin/inotifywait --monitor --recursive --quiet --format '%w' --event create,moved_to $dirs | while read f
do
$act "$f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment