From 836b5df31709f2c6335f4c32149378b63c1d2cc5 Mon Sep 17 00:00:00 2001 From: yaokai13 Date: Fri, 16 Apr 2021 14:30:55 +0800 Subject: [PATCH 1/2] fix some unnecessary statement --- script/tools/delete_iso.sh | 40 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/script/tools/delete_iso.sh b/script/tools/delete_iso.sh index de73ad9..943affa 100644 --- a/script/tools/delete_iso.sh +++ b/script/tools/delete_iso.sh @@ -1,5 +1,5 @@ #!/bin/bash -# usage: bash delete_iso.sh +# usage: bash delete_iso.sh echo "--------------- start delete older iso ----------------" DIR=$1 my_key=$2 @@ -9,27 +9,25 @@ files=`ssh -i $my_key -o StrictHostKeyChecking=no root@121.36.84.172 "ls $DIR | for file in $files do - echo $file - if [[ $file == openeuler-* ]];then - year=`echo $file | cut -d "-" -f 2` - month=`echo $file | cut -d "-" -f 3` - day=`echo $file | cut -d "-" -f 4` - hour=`echo $file | cut -d "-" -f 5` - if [[ -z $hour ]];then - echo "don't delete $DIR/$file, check next" - continue - fi - file=`echo $file | sed 's/\r//g'` - echo "$file +++++++" - date=`date +%s -d "$year-$month-$day"` - if [ `expr $TODAY - $date` -gt `expr $ISO_DAYS \* 24 \* 3600` ];then - if [[ "x$file" != "x*" ]];then - echo "delete directory $DIR/$file" - ssh -i $my_key -o StrictHostKeyChecking=no root@121.36.84.172 "cd $DIR && rm -rf $file" - fi - else - echo "don't delete $DIR/$file" + echo $file + year=`echo $file | cut -d "-" -f 2` + month=`echo $file | cut -d "-" -f 3` + day=`echo $file | cut -d "-" -f 4` + hour=`echo $file | cut -d "-" -f 5` + if [[ -z $hour ]];then + echo "don't delete $DIR/$file, check next" + continue + fi + file=`echo $file | sed 's/\r//g'` + echo "$file +++++++" + date=`date +%s -d "$year-$month-$day"` + if [ `expr $TODAY - $date` -gt `expr $ISO_DAYS \* 24 \* 3600` ];then + if [[ "x$file" != "x*" ]];then + echo "delete directory $DIR/$file" + ssh -i $my_key -o StrictHostKeyChecking=no root@121.36.84.172 "cd $DIR && rm -rf $file" fi + else + echo "don't delete $DIR/$file" fi done -- Gitee From f6903a99b58b150a639191be3e4a775eb6571fcc Mon Sep 17 00:00:00 2001 From: yaokai13 Date: Mon, 19 Apr 2021 11:39:48 +0800 Subject: [PATCH 2/2] change the RELEASE_SERVER_IP to another --- script/setup_env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/setup_env.sh b/script/setup_env.sh index 53a7644..62b221f 100644 --- a/script/setup_env.sh +++ b/script/setup_env.sh @@ -10,7 +10,7 @@ export OS_VERSION="$(echo ${tmp//:/-})" export OBS_UI_IP="172.16.1.81" export OBS_SERVER_IP="172.16.1.95" -export RELEASE_SERVER_IP="172.16.1.241" +export RELEASE_SERVER_IP="172.16.1.29" export RELEASE_SERVER_PORT="30322" if [ -n "${RELEASE_SERVER_PORT}" ];then export SSHPORT="-p ${RELEASE_SERVER_PORT}" -- Gitee