summaryrefslogtreecommitdiff
path: root/byteback-backup
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2014-07-11 09:41:01 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2014-07-11 09:41:01 +0100
commit2ad66bf40e2bbff58d0e3bc77c41fa0dcaef14cc (patch)
tree809d5f1d9b0dcda233841db05e28d03166c3518e /byteback-backup
parent83c070eec66f090d8ab11a5ff38682f0d215601e (diff)
Now defintely treats code 24 as success.
Diffstat (limited to 'byteback-backup')
-rwxr-xr-xbyteback-backup10
1 files changed, 8 insertions, 2 deletions
diff --git a/byteback-backup b/byteback-backup
index c03ee45..8595eb1 100755
--- a/byteback-backup
+++ b/byteback-backup
@@ -247,6 +247,12 @@ def rsync(*sources)
return $?.exitstatus
end
+#
+# We treat exit statuses 0 and 24 as success; 0 is "Success"; 24 is "Partial
+# transfer due to vanished source files", which we treat as success otherwise
+# on some hosts the backup process never finishes.
+#
+RSYNC_EXIT_STATUSES_TO_ACCEPT = [0, 24]
RSYNC_EXIT_STATUSES_TO_RETRY_ON = [10,11,20,21,22,23,30]
# Run the file copy, retrying if necessary
@@ -254,9 +260,9 @@ RSYNC_EXIT_STATUSES_TO_RETRY_ON = [10,11,20,21,22,23,30]
loop do
status = rsync(*@sources)
- if status === 0
+ if RSYNC_EXIT_STATUSES_TO_ACCEPT.any?{|s| s === status}
break
- elsif RSYNC_EXIT_STATUSES_TO_RETRY_ON.include?(status)
+ elsif RSYNC_EXIT_STATUSES_TO_RETRY_ON.any?{|s| s === status}
if @retry_number > 0
@retry_number -= 1
sleep @retry_delay