add record.sh

This commit is contained in:
2021-01-30 13:25:32 +00:00
parent 05d6bc6eab
commit 37891eee86
6 changed files with 75 additions and 52 deletions

View File

@@ -1,19 +1,26 @@
#!/bin/bash
. ./sumsel.conf
. ./sumsel_functions.incl
#Alle WAV Files ausser das letzte File.
#Das letzte File wird gerade recorded und wird beim naechsten Durchlauf verarbeitet
FILES=$(ls -tr ${REC_DIR} |head -n -1)
if set_lockfile;
then
#Alle WAV Files ausser das letzte File.
#Das letzte File wird gerade recorded und wird beim naechsten Durchlauf verarbeitet
FILES=$(ls -tr ${REC_DIR} |head -n -1)
for F in ${FILES}
do
#echo ${F}
#Ermittle ctime des WAV Files
CTIME=$(date -r "${REC_DIR}/${F}" +"%Y%m%d%H%M%S")
ffmpeg -i "${REC_DIR}/${F}" -acodec mp3 "${UPL_DIR}/${CTIME}_${UP_SUFFIX}.mp3"
rm "${REC_DIR}/${F}"
done
for F in ${FILES}
do
#echo ${F}
#Ermittle ctime des WAV Files
CTIME=$(date -r "${REC_DIR}/${F}" +"%Y%m%d%H%M%S")
ffmpeg -i "${REC_DIR}/${F}" -acodec mp3 "${UPL_DIR}/${CTIME}_${UPL_SUFFIX}.mp3"
rm "${REC_DIR}/${F}"
done
rsync -avzh --remove-source-files ${UPL_DIR} ${REMOTE_DIR}
rsync -avzh --remove-source-files ${UPL_DIR} ${REMOTE_DIR}
del_lockfile
else
echo "LOCK error"
fi