summaryrefslogtreecommitdiff
path: root/config/backup.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-12 13:53:28 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-12 13:53:28 +0100
commitc9066760fd1f5f2f892ce2be5cf2a83bb5210246 (patch)
tree82ecdd528e803ccd1b469dc13482e06cf8ea0b8e /config/backup.rb
parent0b97717b2171820dea41de8df705f8f0e4b71464 (diff)
parentfb66a5e5a4c5d5f9eac4a5e8de6a286482cb55d5 (diff)
Release a new beta.5.1-beta4
Diffstat (limited to 'config/backup.rb')
-rw-r--r--config/backup.rb60
1 files changed, 60 insertions, 0 deletions
diff --git a/config/backup.rb b/config/backup.rb
new file mode 100644
index 0000000..e5816c1
--- /dev/null
+++ b/config/backup.rb
@@ -0,0 +1,60 @@
+# encoding: utf-8
+
+require 'inifile'
+SYSTEM_ODBC_CONFIGURATION = IniFile.load('/var/lib/freeswitch/.odbc.ini')
+
+Backup::Model.new(:GS5, 'GS5 backup') do
+
+ ##
+ # Split [Splitter]
+ #
+ # Split the backup file in to chunks of 2 GB
+ # if the backup file size exceeds 2 GB
+ #
+ # split_into_chunks_of 2048
+
+ ##
+ # MySQL [Database]
+ #
+ database MySQL do |db|
+ # To dump all databases, set `db.name = :all` (or leave blank)
+ db.name = SYSTEM_ODBC_CONFIGURATION['gemeinschaft']['DATABASE']
+ db.username = SYSTEM_ODBC_CONFIGURATION['gemeinschaft']['USER']
+ db.password = SYSTEM_ODBC_CONFIGURATION['gemeinschaft']['PASSWORD']
+ db.host = "localhost"
+ db.port = 3306
+ db.socket = "/var/run/mysqld/mysqld.sock"
+ end
+
+ ##
+ # Faxes
+ #
+ if File.exists?('/opt/gemeinschaft/public/uploads/fax_document')
+ archive :faxes do |archive|
+ archive.add '/opt/gemeinschaft/public/uploads/fax_document'
+ end
+ end
+
+ ##
+ # Voicemails
+ #
+ if File.exists?('/var/opt/gemeinschaft/freeswitch/voicemail')
+ archive :voicemails do |archive|
+ archive.add '/var/opt/gemeinschaft/freeswitch/voicemail'
+ end
+ end
+
+ ##
+ # Local (Copy) [Storage]
+ #
+ store_with Local do |local|
+ local.path = "/var/backups/"
+ end
+
+ ##
+ # Gzip [Compressor]
+ #
+ compress_with Gzip
+
+end
+