summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-26 18:04:58 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-26 18:04:58 +0100
commit45e7bcdbf5222ea68de2ec8e6542b079c36758cf (patch)
treee47ac42e4818761bb82fe6c85418ce0544166bf7
parente42f8f22dcf70640a261eb69c07d0e57baab6ac0 (diff)
Small fix.
-rw-r--r--lib/tasks/backup.rake9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake
index d12bf5e..913d7d3 100644
--- a/lib/tasks/backup.rake
+++ b/lib/tasks/backup.rake
@@ -14,15 +14,16 @@ namespace :backup do
FileUtils.rm_rf tmp_dir
FileUtils.mkdir_p tmp_dir
system "cd #{tmp_dir} && tar xzf #{restore_job.backup_file.path}"
- system "cd /tmp/gs5_restore_directory/*/ && tar xf GS5.tar && rm GS5.tar"
+ restore_directory = Dir.glob("/tmp/gs5_restore_directory/*").first
+ system "cd #{restore_directory} && tar xf GS5.tar && rm GS5.tar"
# Restore faxes
#
- system "cd / && tar xzfP /tmp/gs5_restore_directory/*/GS5/archives/faxes.tar.gz"
+ system "cd / && tar xzfP #{restore_directory}/GS5/archives/faxes.tar.gz"
# Restore voicemails
#
- # system "cd / && tar xzfP /tmp/gs5_restore_directory/*/GS5/archives/voicemails.tar.gz"
+ # system "cd / && tar xzfP #{restore_directory}/GS5/archives/voicemails.tar.gz"
# Restore the database
#
@@ -32,7 +33,7 @@ namespace :backup do
db_user = system_odbc_configuration['gemeinschaft']['USER']
db_password = system_odbc_configuration['gemeinschaft']['PASSWORD']
- system "gunzip < /tmp/gs5_restore_directory/*/GS5/databases/MySQL/gemeinschaft.sql.gz | mysql -u #{db_user} -p#{db_password} #{database}"
+ system "gunzip < #{restore_directory}/GS5/databases/MySQL/gemeinschaft.sql.gz | mysql -u #{db_user} -p#{db_password} #{database}"
FileUtils.rm_rf tmp_dir