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. --- config/backup.rb | 2 +- lib/tasks/backup.rake | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/backup.rb b/config/backup.rb index 1c79c04..2a866ef 100644 --- a/config/backup.rb +++ b/config/backup.rb @@ -24,7 +24,7 @@ Backup::Model.new(:GS5, 'GS5 backup') do db.host = "localhost" db.port = 3306 db.socket = "/var/run/mysqld/mysqld.sock" - db.skip_tables = ["backup_jobs", "restore_jobs"] + db.skip_tables = ["backup_jobs", "restore_jobs", "fax_thumbnails"] end ## 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