summaryrefslogtreecommitdiffstats
path: root/roles/caption/templates/inotify-process-captions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'roles/caption/templates/inotify-process-captions.sh')
-rwxr-xr-xroles/caption/templates/inotify-process-captions.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/caption/templates/inotify-process-captions.sh b/roles/caption/templates/inotify-process-captions.sh
new file mode 100755
index 0000000..ce5f416
--- /dev/null
+++ b/roles/caption/templates/inotify-process-captions.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# {{ ansible_managed }}
+
+# This script waits for new webm and mov files
+# in the current directory (recursively) and then calls
+# process-captions to process all the new files that need work.
+inotifywait -r -m "{{ emacsconf_caption_dir }}" -e create -e moved_to |
+ while read directory action file; do
+ if [[ "$file" =~ .*(webm|mov)$ ]]; then
+ "{{ emacsconf_caption_dir }}"/process-captions.py | tee -a "{{ emacsconf_caption_dir }}/captions.log"
+ elif [[ "$file" =~ .*(vtt|srv2|ogg|opus)$ ]]; then
+ # Copy to backstage area
+ rsync --ignore-existing $directory/$file orga@media.emacsconf.org:/var/www/media.emacsconf.org/{{ emacsconf_year }}/backstage/
+ fi
+ done