Skip to content

Commit

Permalink
delete source tar if transfer is successful only (#973)
Browse files Browse the repository at this point in the history
* 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 <ahmad.af.farhat@gmail.com>
Co-authored-by: Ahmad Farhat <ahmad.farhat@blindsidenetworks.com>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent f2deb3e commit 013d5e3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bigbluebutton/scalelite_post_publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 013d5e3

Please sign in to comment.