From 5053adc7c549830acda4d1218efa76f44e107a8a Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 06:51:08 +0100 Subject: Don't store the fax_thumbnails in the backup. Plus recreate them at restore. --- lib/tasks/backup.rake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/tasks/backup.rake') diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake index 8e55be2..61c587b 100644 --- a/lib/tasks/backup.rake +++ b/lib/tasks/backup.rake @@ -23,7 +23,7 @@ namespace :backup do # Restore voicemails # - # system "cd / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/voicemails.tar.gz" + system "cd / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/voicemails.tar.gz" # Restore the database # @@ -38,6 +38,12 @@ namespace :backup do FileUtils.rm_rf tmp_dir system "cd /opt/gemeinschaft && rake db:migrate" + + # Rebuild the thumbnails + # + FaxDocument.each do |fax_document| + fax_document.render_thumbnails + end end end -- cgit v1.2.3 From b11fe0c0c84ea91a27dba87e4c891caf5097440d Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 10:11:49 +0100 Subject: Bugfix --- lib/tasks/backup.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tasks/backup.rake') diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake index 61c587b..c4a4b47 100644 --- a/lib/tasks/backup.rake +++ b/lib/tasks/backup.rake @@ -41,7 +41,7 @@ namespace :backup do # Rebuild the thumbnails # - FaxDocument.each do |fax_document| + FaxDocument.all.each do |fax_document| fax_document.render_thumbnails end end -- cgit v1.2.3 From 784c1eab8b6b19e00f38aa4a1f50f4ccbe11fc89 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 10:13:37 +0100 Subject: Delete a restore_job entry after a restore procedure. --- lib/tasks/backup.rake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/tasks/backup.rake') diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake index c4a4b47..39a4282 100644 --- a/lib/tasks/backup.rake +++ b/lib/tasks/backup.rake @@ -44,6 +44,10 @@ namespace :backup do FaxDocument.all.each do |fax_document| fax_document.render_thumbnails end + + # Delete the restore_job. No need to waste that space. + # + restore_job.destroy end end -- cgit v1.2.3 From 4d6c3cc12ecef9f8c82e448d5ab9fba5fb52ef57 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 10:16:11 +0100 Subject: Delete the archive tar.gz to get more air to breathe. --- lib/tasks/backup.rake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/tasks/backup.rake') diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake index 39a4282..21b0fac 100644 --- a/lib/tasks/backup.rake +++ b/lib/tasks/backup.rake @@ -25,6 +25,10 @@ namespace :backup do # system "cd / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/voicemails.tar.gz" + # Delete the archive tar.gz to get more air to breathe + # + FileUtils.mkdir_p "#{restore_directory}/GS5/archives" + # Restore the database # system_odbc_ini_file = '/var/lib/freeswitch/.odbc.ini' -- cgit v1.2.3