summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-07 11:37:03 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-07 11:37:03 +0100
commit11f186a118285fbc87a536af26730780a9ad01f5 (patch)
treefe6363b036f60f238916d070b3d0cb0625dd53c8 /lib/tasks
parent2b94b16ee1201d15b3b9d66e142df311141a47db (diff)
parent3e19646f46c772e10ed3d7a45e8c974ab23f625b (diff)
Merge branch 'develop'5.1.1
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/backup.rake18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake
index 55369b6..ad4d41d 100644
--- a/lib/tasks/backup.rake
+++ b/lib/tasks/backup.rake
@@ -4,6 +4,18 @@ namespace :backup do
# This would be the daily backup.
end
+ desc "Do a backup."
+ task :queue_a_new_backup => :environment do
+ backup_job = BackupJob.create
+ echo "BackupJob ID: #{backup_job.id}"
+ end
+
+ desc "Do a backup. Now!"
+ task :force_now => :environment do
+ backup_job = BackupJob.create(:state => 'force now')
+ echo "BackupJob ID: #{backup_job.id}"
+ end
+
desc "Restore the system"
task :restore => :environment do
# This task takes the first RestoreJob to restore the system.
@@ -29,6 +41,12 @@ namespace :backup do
system "cd / && 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 / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/recordings.tar.gz"
+ end
+
# Restore avatars
#
if File.exists?("#{restore_directory}/GS5/archives/avatars.tar.gz")