Re: Scanning for updated files setting appears ignored
Ok. I see. If we have to wait for Mac OS X to adopt Java 7 this will take loooong hahaha
#!/bin/sh
#
# Automatically updates serviio library
# if library update is not already running uses serviio REST api
# requires inotifytools and python 2.x
# written by norm at forum.serviio.org
#
VideoFolder="/i-data/md0/video" # your video files location
MusicFolder="/i-data/md0/music" # your music files location
PhotoFolder="/i-data/md0/photo" # your image files location
time_between_refresh=90 # minimum time between library refresh. Sleep Xs set to let file operations end.
script_location="/usr/bin" # directory where pc5dczc_lib_update.py is located
name="inotifywait" # do not modify
Background()
{
if [ ! -x "$(which inotifywait)" ] || [ ! -x "$(which python)" ]; then
echo "inotifywait or python binaries are missing"
exit 1
fi
inotifywait -mr --timefmt '%H%M%S' --format '%T %f' -e move -e delete -e create "$1" |
while read tm file; do
current=$(date +'%H%M%S')
delta=`expr $current - $tm`
if [ $delta -lt 2 -a $delta -gt -2 ]; then
sleep $time_between_refresh # sleep Xs set to let file operations end
python "${script_location}/pc5dczc_lib_update.py" "${file}"
fi
done
}
case $1 in
start)
Background $VideoFolder&
Background $MusicFolder&
Background $PhotoFolder&
echo "Starting Serviio auto refresh ..."
;;
stop)
killall $name
echo "Stopping $0"
;;
status)
_pids=$(pidof $name)
if test -n "$_pids"; then
echo "$name is running, pid:"
pidof $name
else
echo "$name not running"
fi
;;
*)
echo "use $0 [ start | stop | status ]"
;;
esac
Return to Serviio Support & Help
Users browsing this forum: No registered users and 56 guests