From 57e87cb0fbbf96dc780bf15b4dc84573dbe1e45e Mon Sep 17 00:00:00 2001 From: Tatsuki SUGIURA Date: Mon, 21 Oct 2019 12:15:24 +0900 Subject: [PATCH] Continue event if rsync errors. --- create-image | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/create-image b/create-image index 97ca990..7402631 100755 --- a/create-image +++ b/create-image @@ -100,7 +100,9 @@ class ImageCreator begin system("mount", dev, mount_point) or raise "Failed to mount file system #{dev} on #{mount_point}" puts "Copying #{src_host}:#{di.srcpath} to #{dev}..." - system("rsync", "-azHSAX", "--numeric-ids", "--info=progress2", "#{src_host}:#{di.srcpath}/", "#{mount_point}/", *((["--exclude"] * di.exclude.size).zip(di.exclude).flatten)) or raise "rsync fails" + unless system("rsync", "-azHSAX", "--numeric-ids", "--info=progress2", "#{src_host}:#{di.srcpath}/", "#{mount_point}/", *((["--exclude"] * di.exclude.size).zip(di.exclude).flatten)) + warn "rsync exit with error, file transfer may not be completed." + end ensure system("umount", mount_point) File.directory?(mount_point) and -- 2.11.0