-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbatch_transcode_f47_bluefish_ffv1_start.sh
More file actions
executable file
·48 lines (36 loc) · 1.93 KB
/
batch_transcode_f47_bluefish_ffv1_start.sh
File metadata and controls
executable file
·48 lines (36 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash -x
# =========================================================
# Launcher script for H22 batch_transcode_h22_ffv1_v210.py
# =========================================================
date_FULL=$(date +'%Y-%m-%d - %T')
# Local variables from environmental vars
transcode_path1="${BLUEFISH_MKV}"
dump_to="${GIT_TRANSCODE}"
log_path="${SCRIPT_LOG}QNAP_08_bluefish_ffv1_tbc_fix.log"
python_script="${GIT_TRANSCODE}f47_bluefish_ffv1_tbc_fix.py"
function control {
boole=$(cat "${CONTROL_JSON}" | grep "power_off_all" | awk -F': ' '{print $2}')
if [ "$boole" = false, ] ; then
echo "Control json requests script exit immediately" >> "${LOG}"
echo 'Control json requests script exit immediately'
exit 0
fi
}
# Control check inserted into code
control
# replace list to ensure clean data
rm "${dump_to}batch_transcode_f47_bluefish_fix_dump_text.txt"
touch "${dump_to}batch_transcode_f47_bluefish_fix_dump_text.txt"
# Command to build MKV list from two v210 paths containing multiple archive folders
find "${transcode_path1}" -maxdepth 1 -mindepth 1 -name "*.mkv" -mmin +30 >> "${dump_to}batch_transcode_f47_bluefish_fix_dump_text.txt"
if [ -s "${dump_to}batch_transcode_f47_bluefish_fix_dump_text.txt" ]
then
echo " ========================= SHELL SCRIPT LAUNCH ========================== $date_FULL" >> "${log_path}"
echo " == Start transcode of BlueFish MKV to MKV in $transcode_path1 == " >> "${log_path}"
echo " == Shell script creating dump_text.txt output for parallel launch of Python scripts == " >> "${log_path}"
echo " == Launching GNU parallel to run muliple Python3 scripts for encoding == " >> "${log_path}"
grep '/mnt/' "${dump_to}batch_transcode_f47_bluefish_fix_dump_text.txt" | sort -u | shuf | parallel --jobs 3 "${PY3_ENV} ${python_script} {}"
echo " ========================= SHELL SCRIPT END ========================== $(date +'%Y-%m-%d - %T')" >> "${log_path}"
else
exit 1
fi