summaryrefslogtreecommitdiff
path: root/tsp/watchers/watch_diskspace.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tsp/watchers/watch_diskspace.sh')
-rwxr-xr-xtsp/watchers/watch_diskspace.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/tsp/watchers/watch_diskspace.sh b/tsp/watchers/watch_diskspace.sh
index 9fd2e54..9fbe67d 100755
--- a/tsp/watchers/watch_diskspace.sh
+++ b/tsp/watchers/watch_diskspace.sh
@@ -24,9 +24,20 @@ export TSP_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)/.."
PER="$(df -P "${WS_DOWNLOAD}" | grep -o "[0-9]\+%.*$")"
# Leave only numerical value.
PER="${PER%\%*}"
-if [ "$PER" -ge 30 ]
+
+if [ "$PER" -ge 80 ]
then
- nr="$(tsmaster -L DISK_CLEANUP sh "${TSP_DIR}/jobs/free_diskspace.sh")"
- # make the above job urgent
- tsmaster -u "$nr"
+ nr="$(tsmaster -L DISK_CLEANUP sh "${TSP_DIR}/jobs/free_diskspace.sh" 1)"
+else
+ if [ "$PER" -ge 60 ]
+ then
+ nr="$(tsmaster -L DISK_CLEANUP sh "${TSP_DIR}/jobs/free_diskspace.sh" 3)"
+ else
+ if [ "$PER" -ge 40 ]
+ then
+ nr="$(tsmaster -L DISK_CLEANUP sh "${TSP_DIR}/jobs/free_diskspace.sh" 7)"
+ fi
+ fi
fi
+
+test -z "$nr" || tsmaster -u "$nr"