summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bloch <matthew@bytemark.co.uk>2014-12-31 17:58:41 +0000
committerMatthew Bloch <matthew@bytemark.co.uk>2014-12-31 17:58:41 +0000
commit3054b8f5c16a7e0646dccd145dd9accb68800cd9 (patch)
tree01fd69bc514bcddef95bac57faec13b01e2d8208
parentf88dd2535ca5367c89baa7131c2b94565a6a4cd7 (diff)
Roughly deal with ENOSPC condition despite disk being reported as full
(btrfs metadata problem). Possibly needs more safety features.
-rwxr-xr-xTODO.md4
-rwxr-xr-xbyteback-prune13
2 files changed, 15 insertions, 2 deletions
diff --git a/TODO.md b/TODO.md
index 1743c23..ccb6de5 100755
--- a/TODO.md
+++ b/TODO.md
@@ -1,6 +1,10 @@
TODO list for byteback
======================
+* byteback directory should be at the end of the load path, not start
+
+* change default retry parameters to cover 24 hour window
+
* "backup could not be marked as complete" message unhelpful on client system - why?
* how do we stop backups from crashing server's kernel?
diff --git a/byteback-prune b/byteback-prune
index 7e3e83e..2a92209 100755
--- a/byteback-prune
+++ b/byteback-prune
@@ -62,7 +62,14 @@ lock_out_other_processes("byteback-prune")
@df_history = DiskFreeHistory.new(ENV['HOME'])
begin
@df_history.new_reading!
-rescue => anything
+rescue Errno::ENOSPC
+ if @do_list
+ warn("Couldn't write disk history file due to lack of space, ignoring")
+ else
+ warn("Couldn't write disk history file due to lack of space, going to --prune-force")
+ @do_prune = @do_prune_force = true
+ end
+rescue => anything_else
error("Couldn't record disk history of #{@df_history.mountpoint} in #{@df_history.history_file}, installation problem?")
raise
end
@@ -117,7 +124,9 @@ if !@do_prune_force
end
end
-exit 0 unless File.exists?(PRUNING_FLAG) && @do_prune
+exit 0 unless
+ (@do_prune && File.exists?(PRUNING_FLAG)) ||
+ @do_prune_force
exit 0 unless @do_prune_force || gradient_30m == 0