Skip to content

Commit 7da0c3c

Browse files
committed
Add time stamps to console messages
1 parent 7cf02e9 commit 7da0c3c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

watcher/filebot-watcher.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ SETTLE_DOWN_CHECK="5 seconds ago"
55

66

77
inotifywait --monitor "$1" --event create --event moved_to --event modify --exclude '/[.@]' --format '%w%f' $INOTIFYWAIT_OPTS | stdbuf -oL uniq | while read -r FILE; do
8+
TODAY="$(date '+%Y/%m/%d %H:%M:%S %Z')"
9+
810
echo "[INOTIFY] $FILE"
911

1012
# make sure to inform the user that we are waiting for things to settle down
11-
echo "Waiting $SETTLE_DOWN_TIME seconds for changes to settle down..."
13+
echo "[$TODAY] Waiting $SETTLE_DOWN_TIME seconds for changes to settle down..."
1214

1315
# file may yield inode/x-empty for new files
1416
sleep "$SETTLE_DOWN_TIME"
@@ -17,7 +19,7 @@ inotifywait --monitor "$1" --event create --event moved_to --event modify --excl
1719
RECENTLY_MODIFIED_FILES="$(find "$1" -type f -newermt "$SETTLE_DOWN_CHECK" -not -path '*/[.@]*' -print -quit)"
1820

1921
if [ -n "$RECENTLY_MODIFIED_FILES" ]; then
20-
echo "$RECENTLY_MODIFIED_FILES was modified less than $SETTLE_DOWN_CHECK"
22+
echo "[$TODAY] $RECENTLY_MODIFIED_FILES was modified less than $SETTLE_DOWN_CHECK"
2123
echo "Processing deferred until next change..."
2224
continue
2325
fi

0 commit comments

Comments
 (0)