summaryrefslogtreecommitdiff
path: root/tsp/scripts
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2016-07-25 09:36:44 (GMT)
committerAleksander Mistewicz <a.mistewicz@samsung.com>2016-12-06 15:35:49 (GMT)
commit2cc1ae57dd447a361705d4eaafbbc33d90b86cc0 (patch)
tree3593098f014c70e7d475ac817e019633ffb3c9e0 /tsp/scripts
parentcd4d99730d89bdb325f1d43f260da4932f467ab8 (diff)
downloadmajor-2cc1ae57dd447a361705d4eaafbbc33d90b86cc0.zip
major-2cc1ae57dd447a361705d4eaafbbc33d90b86cc0.tar.gz
major-2cc1ae57dd447a361705d4eaafbbc33d90b86cc0.tar.bz2
Update tsp/scripts/free_diskspace.shrefs/changes/39/81339/10
Only directories, modified at least 2 days ago, in WS_DOWNLOAD are processed. All non-snapshot directories are verbosely removed. Change-Id: Ibabb7d874e1e75453c8f348725b99346007e1908 Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
Diffstat (limited to 'tsp/scripts')
-rwxr-xr-xtsp/scripts/free_diskspace.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/tsp/scripts/free_diskspace.sh b/tsp/scripts/free_diskspace.sh
index 5aa0a24..566005c 100755
--- a/tsp/scripts/free_diskspace.sh
+++ b/tsp/scripts/free_diskspace.sh
@@ -23,12 +23,18 @@ export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.."
. "${TSP_DIR}/common.sh"
-for i in $(find "${WS_DOWNLOAD}" -type d -mtime +2)
+for i in $(find "${WS_DOWNLOAD}" -maxdepth 1 -mindepth 1 -type d -mtime +1)
do
- if grep -q "Snapshot" "$(ls $i/diff-*.report)"
+ DIFF_FILE="$(ls $i/diff-*.report)"
+ if [ -z "${DIFF_FILE}" ]
then
- echo "Skipping " "$i"
- continue
+ echo "Missing diff-*.report in: " "$i"
+ else
+ if grep -q "Snapshot" "${DIFF_FILE}"
+ then
+ echo "Snapshot, skipping:" "$i"
+ continue
+ fi
fi
rm -vr "$i"
done