From db9ce11df58dc8311a4eeb2776039bb14a2447c7 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sat, 2 Oct 2021 12:11:58 -0400 Subject: [PATCH] testing new WEEK calculator --- scripts/birdnet_analysis.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index 3ce6763..af5fdf7 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -39,7 +39,22 @@ move_analyzed() { # - {DIRECTORY} run_analysis() { echo "Starting run_analysis() for ${1:19}" - WEEK=$(date +"%U") + + + ### TESTING NEW WEEK CALCULATION + WEEK_OF_YEAR="$(echo "$(date +%m) * 4" | bc -l)" + DAY_OF_MONTH="$(date +%d)" + if [ ${DAY_OF_MONTH} -le 7 ];then + WEEK="$(echo "${WEEK_OF_YEAR} + 1" |bc -l)" + elif [ ${DAY_OF_MONTH} -le 14 ];then + WEEK="$(echo "${WEEK_OF_YEAR} + 2" |bc -l)" + elif [ ${DAY_OF_MONTH} -le 21 ];then + WEEK="$(echo "${WEEK_OF_YEAR} + 3" |bc -l)" + elif [ ${DAY_OF_MONTH} -ge 23 ];then + WEEK="$(echo "${WEEK_OF_YEAR} + 4" |bc -l)" + fi + + #WEEK=$(date +"%U") cd ${HOME}/BirdNET-Lite || exit 1 for i in "${files[@]}";do