summaryrefslogtreecommitdiff
path: root/lib/backup/files.rb
diff options
context:
space:
mode:
authorFrederic Van Espen <fes@escaux.com>2019-03-07 11:14:27 +0100
committerFrederic Van Espen <fes@escaux.com>2019-03-07 11:14:27 +0100
commit31dfc31aaa227224152f200b9fb961404a08fa40 (patch)
tree69f8e54ecf7a7205df5277ae997f0b1d8158835c /lib/backup/files.rb
parent562a1fc87d0269ce5fb1561fea45f8d01f4889de (diff)
parent5a75aa59dbafc8f0c25800f952df1e0aaa2d4dd5 (diff)
downloadgitlab-ce-31dfc31aaa227224152f200b9fb961404a08fa40.tar.gz
Merge branch 'master' into incremental-backups
Diffstat (limited to 'lib/backup/files.rb')
-rw-r--r--lib/backup/files.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/backup/files.rb b/lib/backup/files.rb
index 427c65e2d91..098f2da6d88 100644
--- a/lib/backup/files.rb
+++ b/lib/backup/files.rb
@@ -71,8 +71,14 @@ module Backup
end
def run_pipeline!(cmd_list, options = {})
- status_list = Open3.pipeline(*cmd_list, options)
- raise Backup::Error, 'Backup failed' unless status_list.compact.all?(&:success?)
+ err_r, err_w = IO.pipe
+ options[:err] = err_w
+ status = Open3.pipeline(*cmd_list, options)
+ err_w.close
+ return if status.compact.all?(&:success?)
+
+ regex = /^g?tar: \.: Cannot mkdir: No such file or directory$/
+ raise Backup::Error, 'Backup failed' unless err_r.read =~ regex
end
end
end