diff options
Diffstat (limited to 'lib/backup/files.rb')
-rw-r--r-- | lib/backup/files.rb | 10 |
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 |