From 87a53dce50cdb89fdddafd8f2307076ab6e394bc Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Mon, 6 Jun 2011 13:38:16 -0400 Subject: [PATCH] - archive only new recordings --- .../core/scripts/archive/archive.rb | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/record-and-playback/core/scripts/archive/archive.rb b/record-and-playback/core/scripts/archive/archive.rb index 4c9e0349eb..4754525c47 100755 --- a/record-and-playback/core/scripts/archive/archive.rb +++ b/record-and-playback/core/scripts/archive/archive.rb @@ -4,9 +4,6 @@ require 'trollop' require 'yaml' - - - def archive_audio(meeting_id, audio_dir, raw_archive_dir) BigBlueButton.logger.info("Archiving audio #{audio_dir}/#{meeting_id}*.wav.") begin @@ -86,16 +83,19 @@ done_files.each do |df| meeting_id = match[1] target_dir = "#{raw_archive_dir}/#{meeting_id}" - if FileTest.directory?(target_dir) - FileUtils.remove_dir target_dir + if not FileTest.directory?(target_dir) + FileUtils.mkdir_p target_dir + archive_events(meeting_id, redis_host, redis_port, raw_archive_dir) + archive_audio(meeting_id, audio_dir, raw_archive_dir) + archive_presentation(meeting_id, presentation_dir, raw_archive_dir) + archive_deskshare(meeting_id, deskshare_dir, raw_archive_dir) + archive_video(meeting_id, video_dir, raw_archive_dir) + archive_done = File.new("#{recording_dir}/status/archived/#{meeting_id}.done", "w") + archive_done.write("Archived #{meeting_id}") + archive_done.close + else + BigBlueButton.logger.debug("Skipping #{meeting_id} as it has already been archived.") end - FileUtils.mkdir_p target_dir - - archive_events(meeting_id, redis_host, redis_port, raw_archive_dir) - archive_audio(meeting_id, audio_dir, raw_archive_dir) - archive_presentation(meeting_id, presentation_dir, raw_archive_dir) - archive_deskshare(meeting_id, deskshare_dir, raw_archive_dir) - archive_video(meeting_id, video_dir, raw_archive_dir) end