Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2016-11-09 08:17:44 -0500
committerSravan Kumar Lakkimsetti2016-11-11 03:13:55 -0500
commit77f785254b9135d47594ae87c802636d9497e074 (patch)
treeff53a4979cc05e1981149df094b950dbc6288e0c
parent62753aa58cb3ef8e9d1808ea31a6553f0d581ef3 (diff)
downloadeclipse.platform.releng.aggregator-77f785254b9135d47594ae87c802636d9497e074.tar.gz
eclipse.platform.releng.aggregator-77f785254b9135d47594ae87c802636d9497e074.tar.xz
eclipse.platform.releng.aggregator-77f785254b9135d47594ae87c802636d9497e074.zip
Bug 507271 - Implement new build retention policy for I-builds
Change-Id: I623e5a818bee51551bd50c4e266a91cef93a48e6 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-rwxr-xr-xproduction/sdk/cleaners/dailyCleanDownloads.sh29
1 files changed, 20 insertions, 9 deletions
diff --git a/production/sdk/cleaners/dailyCleanDownloads.sh b/production/sdk/cleaners/dailyCleanDownloads.sh
index d8aef239..9ad54a8e 100755
--- a/production/sdk/cleaners/dailyCleanDownloads.sh
+++ b/production/sdk/cleaners/dailyCleanDownloads.sh
@@ -22,10 +22,10 @@ fi
echo -e "\n\tDaily clean of ${HOSTNAME} download server on $(date )\n"
cDir="/home/data/httpd/download.eclipse.org/eclipse/downloads/drops4"
-buildType="N*"
-allOldBuilds=$( find ${cDir} -maxdepth 1 -type d -ctime +3 -name "${buildType}" )
+buildType="I*2000"
+allOldBuilds=$( find ${cDir} -maxdepth 1 -type d -ctime +7 -name "${buildType}" )
nbuilds=$( find ${cDir} -maxdepth 1 -type d -name "${buildType}" | wc -l )
-echo -e "\tNumber of N-builds before cleaning: $nbuilds"
+echo -e "\tNumber of I-builds before cleaning: $nbuilds"
#echo -e "\n\tDEBUG: allOldBuilds: \n${allOldBuilds}"
# Make sure we leave at least 4 on DL server, no matter how old
@@ -57,13 +57,24 @@ for buildname in ${allOldBuilds}; do
then
echo -e "\tDEBUG: Not removed (since one of 4 newest, even though old): \n\t$buildname"
else
- rm -fr $buildname
- RC=$?
- if [[ $RC = 0 ]]
+ buildId=$(basename $buildName)
+ yy=$(echo $buildId|cut -b2-5)
+ mm=$(echo $buildId|cut -b6-7)
+ dd=$(echo $buildId|cut -b8-9)
+ day=${dd}-${mm}-${yy}
+ dayOfWeek=$(date -d $day +%u)
+
+ #Make sure donot remove I builds from Monday
+ if [ $dayOfWeek != 1 ]
then
- echo -e "Removed: $buildname"
- else
- echo -e "\n\tAn Error occurred removing $buildname. RC: $RC"
+ rm -fr $buildname
+ RC=$?
+ if [[ $RC = 0 ]]
+ then
+ echo -e "Removed: $buildname"
+ else
+ echo -e "\n\tAn Error occurred removing $buildname. RC: $RC"
+ fi
fi
fi
done

Back to the top