summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/backup_job.rb2
-rw-r--r--lib/tasks/backup.rake16
-rw-r--r--misc/freeswitch/conf/freeswitch.xml32
3 files changed, 38 insertions, 12 deletions
diff --git a/app/models/backup_job.rb b/app/models/backup_job.rb
index 9cb4f53..e2f2e6c 100644
--- a/app/models/backup_job.rb
+++ b/app/models/backup_job.rb
@@ -37,7 +37,7 @@ class BackupJob < ActiveRecord::Base
if tmp_backup_directory.blank?
self.state = 'failed'
else
- system "cd #{backup_directory} && nice -n 19 sudo /bin/tar czf #{backup_name_prefix}#{File.basename(tmp_backup_directory)}.tar.gz #{File.basename(tmp_backup_directory)}"
+ system "cd #{backup_directory} && nice -n 19 ionice -c2 -n7 sudo /bin/tar czf #{backup_name_prefix}#{File.basename(tmp_backup_directory)}.tar.gz #{File.basename(tmp_backup_directory)}"
require 'fileutils'
FileUtils.rm_rf tmp_backup_directory
file = File::Stat.new("#{backup_directory}/#{backup_name_prefix}#{File.basename(tmp_backup_directory)}.tar.gz")
diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake
index 83bcfd3..0dbadad 100644
--- a/lib/tasks/backup.rake
+++ b/lib/tasks/backup.rake
@@ -25,32 +25,32 @@ namespace :backup do
tmp_dir = "/tmp/gs5_restore_directory"
FileUtils.rm_rf tmp_dir
FileUtils.mkdir_p tmp_dir
- system "cd #{tmp_dir} && nice -n 19 sudo /bin/tar xzf #{restore_job.backup_file.path}"
+ system "cd #{tmp_dir} && nice -n 19 ionice -c2 -n7 sudo /bin/tar xzf #{restore_job.backup_file.path}"
restore_directory = Dir.glob("/tmp/gs5_restore_directory/*").first
- system "cd #{restore_directory} && nice -n 19 sudo /bin/tar xf GS5.tar && rm GS5.tar"
+ system "cd #{restore_directory} && nice -n 19 ionice -c2 -n7 sudo /bin/tar xf GS5.tar && rm GS5.tar"
# Restore faxes
#
if File.exists?("#{restore_directory}/GS5/archives/faxes.tar.gz")
- system "cd / && nice -n 19 sudo /bin/tar xzfP #{restore_directory}/GS5/archives/faxes.tar.gz"
+ system "cd / && nice -n 19 ionice -c2 -n7 sudo /bin/tar xzfP #{restore_directory}/GS5/archives/faxes.tar.gz"
end
# Restore voicemails
#
if File.exists?("#{restore_directory}/GS5/archives/voicemails.tar.gz")
- system "cd / && nice -n 19 sudo /bin/tar xzfP #{restore_directory}/GS5/archives/voicemails.tar.gz"
+ system "cd / && nice -n 19 ionice -c2 -n7 sudo /bin/tar xzfP #{restore_directory}/GS5/archives/voicemails.tar.gz"
end
# Restore recordings
#
if File.exists?("#{restore_directory}/GS5/archives/recordings.tar.gz")
- system "cd / && nice -n 19 sudo /bin/tar xzfP #{restore_directory}/GS5/archives/recordings.tar.gz"
+ system "cd / && nice -n 19 ionice -c2 -n7 sudo /bin/tar xzfP #{restore_directory}/GS5/archives/recordings.tar.gz"
end
# Restore avatars
#
if File.exists?("#{restore_directory}/GS5/archives/avatars.tar.gz")
- system "cd / && nice -n 19 sudo /bin/tar xzfP #{restore_directory}/GS5/archives/avatars.tar.gz"
+ system "cd / && nice -n 19 ionice -c2 -n7 sudo /bin/tar xzfP #{restore_directory}/GS5/archives/avatars.tar.gz"
end
# Delete the archive tar.gz to get more air to breathe
@@ -65,11 +65,11 @@ namespace :backup do
db_user = system_odbc_configuration['gemeinschaft']['USER']
db_password = system_odbc_configuration['gemeinschaft']['PASSWORD']
- system "nice -n 19 gunzip < #{restore_directory}/GS5/databases/MySQL/gemeinschaft.sql.gz | nice -n 19 mysql -u #{db_user} -p#{db_password} #{database}"
+ system "nice -n 19 ionice -c2 -n7 gunzip < #{restore_directory}/GS5/databases/MySQL/gemeinschaft.sql.gz | nice -n 19 ionice -c2 -n7 mysql -u #{db_user} -p#{db_password} #{database}"
FileUtils.rm_rf tmp_dir
- system "cd /opt/gemeinschaft && nice -n 19 rake db:migrate"
+ system "cd /opt/gemeinschaft && nice -n 19 ionice -c2 -n7 rake db:migrate"
# Rebuild the thumbnails
#
diff --git a/misc/freeswitch/conf/freeswitch.xml b/misc/freeswitch/conf/freeswitch.xml
index 025641b..7283211 100644
--- a/misc/freeswitch/conf/freeswitch.xml
+++ b/misc/freeswitch/conf/freeswitch.xml
@@ -1224,7 +1224,21 @@
<param name="interval" value="20"/>
<param name="timer-name" value="soft"/>
</directory>
- </configuration>
+ <directory name="mohh/shout" path="/var/opt/gemeinschaft/shout">
+ <param name="rate" value="16000"/>
+ <param name="shuffle" value="true"/>
+ <param name="channels" value="1"/>
+ <param name="interval" value="10"/>
+ <param name="timer-name" value="soft"/>
+ </directory>
+ <directory name="moh/shout" path="/var/opt/gemeinschaft/shout">
+ <param name="rate" value="8000"/>
+ <param name="shuffle" value="true"/>
+ <param name="channels" value="1"/>
+ <param name="interval" value="10"/>
+ <param name="timer-name" value="soft"/>
+ </directory>
+ </configuration>
<configuration name="logfile.conf" description="File Logging">
<settings>
<param name="rotate-on-hup" value="true"/>
@@ -1323,6 +1337,14 @@
<param name="file-prefix" value="fax_in_"/>
</settings>
</configuration>
+ <configuration name="shout.conf" description="Shoutcast stream config">
+ <settings>
+ <!-- Don't change these unless you are insane -->
+ <!--<param name="decoder" value="i586"/>-->
+ <param name="volume" value="0.7"/>
+ <!--<param name="outscale" value="8192"/>-->
+ </settings>
+ </configuration>
<configuration name="modules.conf" description="Modules">
<modules>
<load module="mod_console"/>
@@ -1342,16 +1364,20 @@
<load module="mod_native_file"/>
<load module="mod_local_stream"/>
<load module="mod_tone_stream"/>
+ <load module="mod_shout"/>
<load module="mod_say_en"/>
<load module="mod_say_de"/>
<load module="mod_spandsp"/>
<load module="mod_snmp"/>
<load module="mod_dingaling"/>
+ <!-- Uncomment the following line after running
+ 'gs-addon install fs-g729' -->
+ <!--<load module="mod_com_g729"/>-->
</modules>
- </configuration>
+ </configuration>
<configuration name="lua.conf" description="LUA Configuration">
<settings>
- <param name="module-directory" value="/usr/lib/i386-linux-gnu/lua/5.1/?.so;"/>
+ <param name="module-directory" value="/usr/lib/local-platform/lua/5.1/?.so;"/>
<param name="script-directory" value="/usr/share/freeswitch/scripts/?.lua;/usr/share/lua/5.1/?.lua;"/>
<param name="xml-handler-script" value="configuration.lua"/>
<param name="xml-handler-bindings" value="directory|configuration"/>