From 76ebf187a46341dcde24205033dd8052f0a3809b Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Fri, 6 May 2016 11:22:49 +0200 Subject: Add tsp/scripts/free_diskspace.sh Change-Id: Iae5463f09e9c20d118c456ee4c7b85fc6ae1da86 Signed-off-by: Aleksander Mistewicz --- tsp/scripts/free_diskspace.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tsp/scripts/free_diskspace.sh (limited to 'tsp/scripts') diff --git a/tsp/scripts/free_diskspace.sh b/tsp/scripts/free_diskspace.sh new file mode 100755 index 0000000..88ff2ed --- /dev/null +++ b/tsp/scripts/free_diskspace.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Author: Aleksander Mistewicz + +# Assume that most of the space is taken up by downloaded images. +# Delete ones that were modified at least 3 days ago. +for i in $(find "${HOME}/ws/dwn" -type d -mtime +2) +do + rm -vr "$i" +done -- cgit v1.2.3