ffmpeg-mythtv/ffmpeg-myth.sh

27 lines
893 B
Bash
Executable File

#!/bin/bash
set -aex
export LANG=en_US.UTF-8
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
# ugly kludge due to upgrade from 16.04 to 18.04 mismatch
# export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/tmp/root-snap-2020-06-28-21-56-27/usr/lib/x86_64-linux-gnu
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
unset -v LANGUAGE
working_dir=${working_dir:-"/mnt/lvraid5/ffmpeg-cut-list.d"}
error_log=${error_log:-"user-job-$(date +'%Y-%m-%d-%H%M').err"}
outpt_log=${error_log/err/log}
debug=${debug:-"eval nice -n 19 ionice -c 3 "}
ffmpeg_myth_scm=${ffmpeg_myth_scm:-"/usr/local/bin/ffmpeg-myth.scm"}
if test -z "$*"; then
job=${job:-"ffmpeg-myth-do-pending-jobs 4"}
else
job="$*"
fi
cmd="$ffmpeg_myth_scm $job"
(cd "$working_dir" && printenv && $debug $cmd) >> $working_dir/$outpt_log 2>> $working_dir/$error_log