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