From 0daa99dbb20753cd4a5703826e64df3c2b7f7328 Mon Sep 17 00:00:00 2001 From: Frederik Baerentsen Date: Tue, 12 Jul 2022 12:07:49 +0200 Subject: [PATCH] updated bash script --- Update Missing/update.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Update Missing/update.sh b/Update Missing/update.sh index 362b85c..12bb74c 100644 --- a/Update Missing/update.sh +++ b/Update Missing/update.sh @@ -8,22 +8,24 @@ error_exit() { source ../.apikey || error_exit "Cannot find apikey" d=`date +%Y%m%d` - -echo "Todays date $d" #mv "missing.mcl" "missing_old.mcl" fromdate=$(ls -1 *_latest.mcl |grep -Eo '[[:digit:]]{8}') || error_exit "cannot latest mcl file" +fromdate2=$(date -d "$fromdate" +%Y-%m-%d) +d2=`date +%Y-%m-%d` -echo "Last date run $fromdate" +TEMP=$(echo "update_missing.py" "$fromdate""_latest.mcl" "$d"".mcl" "$api_key" "$fromdate2" "$d2") -python2 "update_missing.py" "$fromdate""_latest.mcl" "$d"".mcl" $api_key $fromdate $d || error_exit "update_missing.py failed" +/usr/bin/python2 $TEMP -mv "$d"".mcl" "$d""_latest.mcl" || error_exit "cannot cp $d to latest" -mv "$fromdate""_latest.mcl" "archive/""$fromdate"".mcl" || error_exit "cannot mv to archive" +#exit -git add "$d""_latest.mcl" "archive/" -git commit -m "Updated $d" +#mv "$d"".mcl" "$d""_latest.mcl" || error_exit "cannot cp $d to latest" +#mv "$fromdate""_latest.mcl" "archive/""$fromdate"".mcl" || error_exit "cannot mv to archive" + +#git add "$d""_latest.mcl" "archive/" +#git commit -m "Updated $d" #git push origin master