2011-06-08 22:57:52 +08:00
|
|
|
require '../../core/lib/recordandplayback'
|
|
|
|
require 'rubygems'
|
|
|
|
require 'yaml'
|
|
|
|
|
|
|
|
bbb_props = YAML::load(File.open('../../core/scripts/bigbluebutton.yml'))
|
|
|
|
matt_props = YAML::load(File.open('matterhorn.yml'))
|
2011-08-06 02:25:44 +08:00
|
|
|
scp_server = matt_props['server']
|
|
|
|
scp_inbox = matt_props['inbox']
|
|
|
|
scp_key = matt_props['key']
|
|
|
|
scp_user = matt_props['user']
|
2011-06-08 22:57:52 +08:00
|
|
|
recording_dir = bbb_props['recording_dir']
|
|
|
|
|
|
|
|
done_files = Dir.glob("#{recording_dir}/status/processed/*.done")
|
|
|
|
done_files.each do |df|
|
|
|
|
match = /(.*)-(.*).done/.match df.sub(/.+\//, "")
|
|
|
|
meeting_id = match[1]
|
|
|
|
if (match[2] == "matterhorn")
|
2012-02-28 02:33:22 +08:00
|
|
|
BigBlueButton.logger = Logger.new("/var/log/bigbluebutton/matterhorn/publish-#{meeting_id}.log", 'daily' )
|
2011-06-08 22:57:52 +08:00
|
|
|
|
|
|
|
process_dir = "#{recording_dir}/process/matterhorn/#{meeting_id}"
|
|
|
|
target_dir = "#{recording_dir}/publish/matterhorn/#{meeting_id}"
|
|
|
|
if not FileTest.directory?(target_dir)
|
|
|
|
FileUtils.mkdir_p target_dir
|
|
|
|
|
|
|
|
WEBCAM = "muxed-audio-webcam.flv"
|
|
|
|
DESKSHARE = "deskshare.flv"
|
|
|
|
MANIFEST = "manifest.xml"
|
|
|
|
DUBLIN = "dublincore.xml"
|
|
|
|
|
|
|
|
[WEBCAM, DESKSHARE, MANIFEST, DUBLIN].each { |file| FileUtils.cp("#{process_dir}/#{file}", target_dir)}
|
|
|
|
|
|
|
|
Dir.chdir(target_dir) do
|
|
|
|
BigBlueButton::MatterhornProcessor.zip_artifacts(WEBCAM, DESKSHARE, DUBLIN, MANIFEST, "#{meeting_id}.zip")
|
|
|
|
end
|
|
|
|
|
2011-06-09 08:28:12 +08:00
|
|
|
command = "scp -i #{scp_key} -o StrictHostKeyChecking=no -o CheckHostIP=no #{target_dir}/#{meeting_id}.zip #{scp_user}@#{scp_server}:#{scp_inbox}"
|
2011-06-08 22:57:52 +08:00
|
|
|
BigBlueButton.logger.info(command)
|
|
|
|
Open3.popen3(command) do | stdin, stdout, stderr|
|
|
|
|
BigBlueButton.logger.info("scp result=#{$?.exitstatus}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|