From c87ae5fce885d2424b22ea49f687c10105d195ed Mon Sep 17 00:00:00 2001 From: Chris Cottam Date: Tue, 3 Apr 2018 17:33:54 +0100 Subject: minimal changes to remove gradient based decision making --- bin/byteback-prune | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/bin/byteback-prune b/bin/byteback-prune index da0b72c..ba64df1 100755 --- a/bin/byteback-prune +++ b/bin/byteback-prune @@ -75,8 +75,6 @@ rescue => anything_else raise end -gradient_30m = @df_history.gradient(1800) - # Check whether we should still be pruning # @free = @df_history.list.last.percent_free @@ -116,14 +114,7 @@ if @do_list end end -# Don't do anything if we've not got two hours of readings -# unless @do_prune_force - if @df_history.list.last.time - @df_history.list.first.time < 1800 - warn('Not enough disc space history to make a decision') - exit 0 - end - # # Do not prune unless at least one snapshot is a week old # @@ -139,7 +130,7 @@ exit 0 unless (@do_prune && File.exist?(PRUNING_FLAG)) || @do_prune_force -exit 0 unless @do_prune_force || gradient_30m == 0 +exit 0 unless @do_prune_force if snapshots.empty? error('No snapshots to delete, is there enough disc space?') -- cgit v1.2.1