fix lock remover+remove old streams

This commit is contained in:
lulzette 2021-04-24 10:19:38 +03:00
parent 56906d9b16
commit 3c7cc07dcd
2 changed files with 7 additions and 4 deletions

View File

@ -17,9 +17,8 @@ source $full_path/config_list.sh
touch $storage_path/$1/pid touch $storage_path/$1/pid
#exit if no stream #exit if no stream and remove lock
$full_path/lifeChk.py $1 $twitchid || rm $storage_path/$1/pid ; exit 0 $full_path/lifeChk.py $1 $twitchid || rm $storage_path/$1/pid || exit 0
# echo `$full_path/lifeChk.py $1`
#set pid and start recording #set pid and start recording
/home/losted/.local/bin/youtube-dl -v -o $storage_path/$1/"%(upload_date)s_%(title)s__%(timestamp)s_%(id)s.%(ext)s" twitch.tv/$1 >> $storage_path/$1/youtube-dl.log 2>&1 /home/losted/.local/bin/youtube-dl -v -o $storage_path/$1/"%(upload_date)s_%(title)s__%(timestamp)s_%(id)s.%(ext)s" twitch.tv/$1 >> $storage_path/$1/youtube-dl.log 2>&1

View File

@ -23,3 +23,7 @@ for i in $list; do
[[ -f $storage_path/$i/pid ]] && echo $i "is recording!" || echo $i "is not recording" [[ -f $storage_path/$i/pid ]] && echo $i "is recording!" || echo $i "is not recording"
done done
echo "====" echo "===="
echo "Removing old files (older than $ctime_remove days)"
find $storage_path/ -ctime +$ctime_remove -name "*mp4*"
find $storage_path/ -ctime +$ctime_remove -name "*mp4*" -exec rm {} \;
echo "Done"