diff --git a/lib/syskit/cli/log_runtime_archive.rb b/lib/syskit/cli/log_runtime_archive.rb index 8d47e92f3..a05fb7be0 100644 --- a/lib/syskit/cli/log_runtime_archive.rb +++ b/lib/syskit/cli/log_runtime_archive.rb @@ -176,9 +176,14 @@ def self.transfer_dataset( end transfer_results = candidates.map do |child_path| - result = transfer_file(child_path, server, root) - child_path.unlink if result.success? - + child_partial_path = Pathname.new("#{child_path}.partial") + File.rename(child_path, child_partial_path) + result = transfer_file(child_partial_path, server, root) + if result.success? + child_partial_path.unlink + else + File.rename(child_partial_path, child_path) + end result end diff --git a/lib/syskit/roby_app/log_transfer_server/ftp_upload.rb b/lib/syskit/roby_app/log_transfer_server/ftp_upload.rb index 228a98d9a..f0bf33040 100644 --- a/lib/syskit/roby_app/log_transfer_server/ftp_upload.rb +++ b/lib/syskit/roby_app/log_transfer_server/ftp_upload.rb @@ -87,8 +87,10 @@ def chdir_to_file_directory(ftp, root) def transfer(ftp, root) last = Time.now chdir_to_file_directory(ftp, root) if root + partial_file = @file + renamed_file = partial_file.basename.to_s.sub(/\.partial$/, "") File.open(@file) do |file_io| - ftp.storbinary("STOR #{File.basename(@file)}", + ftp.storbinary("STOR #{renamed_file}", file_io, Net::FTP::DEFAULT_BLOCKSIZE) do |buf| now = Time.now rate_limit(buf.size, now, last)