From 013d5e31104dc254122a1352f8c33b85d39fba64 Mon Sep 17 00:00:00 2001 From: anmg Date: Thu, 26 Oct 2023 17:28:10 +0300 Subject: [PATCH] delete source tar if transfer is successful only (#973) * delete source tar if transfer is successful only current script removes tar even if transfer failed. using rsync option we have possibility to remove source in case transfer is successful only. if failed we can transfer failed tars later. * Update scalelite_post_publish.rb --------- Co-authored-by: Ahmad Farhat Co-authored-by: Ahmad Farhat --- bigbluebutton/scalelite_post_publish.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bigbluebutton/scalelite_post_publish.rb b/bigbluebutton/scalelite_post_publish.rb index fdc3197e..f334bc21 100755 --- a/bigbluebutton/scalelite_post_publish.rb +++ b/bigbluebutton/scalelite_post_publish.rb @@ -72,7 +72,7 @@ end puts("Transferring recording archive to #{spool_dir}") - system('rsync', '--verbose', '--protect-args', *extra_rsync_opts, archive_file, spool_dir) \ + system('rsync', '--verbose', '--remove-source-files', '--protect-args', *extra_rsync_opts, archive_file, spool_dir) \ || raise('Failed to transfer recording archive') # Delete recording after transfer @@ -85,6 +85,4 @@ File.write("#{recording_dir}/status/published/#{meeting_id}-sender.done", "Published #{meeting_id}") puts('Recording transferring to Scalelite ends') -ensure - FileUtils.rm_f(archive_file) end