diff options
author | Sravan Kumar Lakkimsetti | 2019-10-29 10:06:26 +0000 |
---|---|---|
committer | Sravan Kumar Lakkimsetti | 2019-10-29 10:06:26 +0000 |
commit | d2bef0dd12cda56df98f3da890dd77a4653b6c99 (patch) | |
tree | aca41bdfff6fb337371722f97487acac5f90a050 | |
parent | d3b14da8f335fe66d57174e537580bfce769e62e (diff) | |
download | eclipse.platform.releng.aggregator-d2bef0dd12cda56df98f3da890dd77a4653b6c99.tar.gz eclipse.platform.releng.aggregator-d2bef0dd12cda56df98f3da890dd77a4653b6c99.tar.xz eclipse.platform.releng.aggregator-d2bef0dd12cda56df98f3da890dd77a4653b6c99.zip |
Bug 552511 - Create cleanup script for equinox downloads
Change-Id: Ia6af578ef56d32299fab542dbe636b100cd86d04
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-rwxr-xr-x | cje-production/cleaners/cleanupEquinox.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cje-production/cleaners/cleanupEquinox.sh b/cje-production/cleaners/cleanupEquinox.sh new file mode 100755 index 000000000..0eb056a90 --- /dev/null +++ b/cje-production/cleaners/cleanupEquinox.sh @@ -0,0 +1,39 @@ +#!/bin/bash +#******************************************************************************* +# Copyright (c) 2019 IBM Corporation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# David Williams - initial API and implementation +#******************************************************************************* + +remoteBase=/home/data/httpd/download.eclipse.org + +equinoxBuilds=$remoteBase/equinox/drops + +clean() { + dir=$1 + prefix=$2 + pushd $dir > /dev/null + + builds=$( ls --format=single-column -d $prefix* | sort | head -n-3 ) + + if [[ ! -z $builds ]]; then + for f in $builds; do + echo -e "\tDeleting: $f\n" + rm -rf $f + done + fi + popd > /dev/null +} + + +echo -e "\n\tCurrent date: $(date +%Y\ %m%d\ %H:%M)" +echo -e "\tRemoving drops from downloads server at ${equinoxBuilds}\n" +clean $equinoxBuilds I |