summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-05 15:11:56 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-05 15:11:56 +0100
commit75b36967fed9db8268391ac10b02f5c0870c32ca (patch)
tree73c591300771545c3abffb767657d68872535122
parentc7389cb6f1a305bc7e5cfefd9548c1e1bf7b6018 (diff)
Finetuning backup.
-rw-r--r--app/models/ability.rb4
-rw-r--r--app/models/backup_job.rb3
-rw-r--r--config/backup.rb4
3 files changed, 8 insertions, 3 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 0d13dab..01f26aa 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -64,6 +64,10 @@ class Ability
#
cannot [:edit, :update], FaxDocument
+ # Backups can't be edited
+ #
+ cannot [:edit, :update], BackupJob
+
# Can manage GsNodes
#
can :manage, GsNode
diff --git a/app/models/backup_job.rb b/app/models/backup_job.rb
index 5149553..b0a588f 100644
--- a/app/models/backup_job.rb
+++ b/app/models/backup_job.rb
@@ -6,8 +6,9 @@ class BackupJob < ActiveRecord::Base
private
def start_the_backup
if self.finished_at.nil?
- system "backup perform --trigger gs5 --config_file #{Rails.root.join('config','backup.rb')}"
+ system "backup perform --trigger GS5 --config_file #{Rails.root.join('config','backup.rb')}"
self.finished_at = Time.now
+ self.status = 'done'
self.save
end
end
diff --git a/config/backup.rb b/config/backup.rb
index 4e5cbf2..46ef058 100644
--- a/config/backup.rb
+++ b/config/backup.rb
@@ -3,7 +3,7 @@
require 'inifile'
SYSTEM_ODBC_CONFIGURATION = IniFile.load('/var/lib/freeswitch/.odbc.ini')
-Backup::Model.new(:gs5, 'GS5 backup') do
+Backup::Model.new(:GS5, 'GS5 backup') do
##
# Split [Splitter]
@@ -45,7 +45,7 @@ Backup::Model.new(:gs5, 'GS5 backup') do
# Local (Copy) [Storage]
#
store_with Local do |local|
- local.path = "/var/backups/GS5/"
+ local.path = "/var/backups/"
local.keep = 3
end