summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/backup_job.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/backup_job.rb b/app/models/backup_job.rb
index d579b79..5149553 100644
--- a/app/models/backup_job.rb
+++ b/app/models/backup_job.rb
@@ -1,12 +1,12 @@
class BackupJob < ActiveRecord::Base
attr_accessible :started_at, :finished_at, :state, :directory, :size_of_the_backup
- after_save :start_the_backup
+ after_create :start_the_backup
private
def start_the_backup
if self.finished_at.nil?
- sh "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.save
end