From 3c7cc07dcdf519c6ee092d4ac77d7d569d6800ec Mon Sep 17 00:00:00 2001 From: lulzette Date: Sat, 24 Apr 2021 10:19:38 +0300 Subject: [PATCH] fix lock remover+remove old streams --- check.sh | 7 +++---- cron.sh | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/check.sh b/check.sh index ccabbe2..8272881 100755 --- a/check.sh +++ b/check.sh @@ -17,12 +17,11 @@ source $full_path/config_list.sh touch $storage_path/$1/pid -#exit if no stream -$full_path/lifeChk.py $1 $twitchid || rm $storage_path/$1/pid ; exit 0 -# echo `$full_path/lifeChk.py $1` +#exit if no stream and remove lock +$full_path/lifeChk.py $1 $twitchid || rm $storage_path/$1/pid || exit 0 #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 -#remove pid +# remove pid rm $storage_path/$1/pid diff --git a/cron.sh b/cron.sh index beea1ef..6ec9866 100755 --- a/cron.sh +++ b/cron.sh @@ -23,3 +23,7 @@ for i in $list; do [[ -f $storage_path/$i/pid ]] && echo $i "is recording!" || echo $i "is not recording" done 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" \ No newline at end of file