summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/backup.rb9
-rw-r--r--lib/tasks/backup.rake14
2 files changed, 21 insertions, 2 deletions
diff --git a/config/backup.rb b/config/backup.rb
index b50f7a8..88edd94 100644
--- a/config/backup.rb
+++ b/config/backup.rb
@@ -62,6 +62,15 @@ Backup::Model.new(:GS5, 'GS5 backup') do
end
##
+ # Avatars
+ #
+ if File.exists?('/opt/gemeinschaft/public/uploads/user/image')
+ archive :avatars do |archive|
+ archive.add '/opt/gemeinschaft/public/uploads/user/image'
+ end
+ end
+
+ ##
# Local (Copy) [Storage]
#
store_with Local do |local|
diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake
index 21b0fac..55369b6 100644
--- a/lib/tasks/backup.rake
+++ b/lib/tasks/backup.rake
@@ -19,11 +19,21 @@ namespace :backup do
# Restore faxes
#
- system "cd / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/faxes.tar.gz"
+ if File.exists?("#{restore_directory}/GS5/archives/faxes.tar.gz")
+ system "cd / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/faxes.tar.gz"
+ end
# Restore voicemails
#
- system "cd / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/voicemails.tar.gz"
+ if File.exists?("#{restore_directory}/GS5/archives/voicemails.tar.gz")
+ system "cd / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/voicemails.tar.gz"
+ end
+
+ # Restore avatars
+ #
+ if File.exists?("#{restore_directory}/GS5/archives/avatars.tar.gz")
+ system "cd / && sudo /bin/tar xzfP #{restore_directory}/GS5/archives/avatars.tar.gz"
+ end
# Delete the archive tar.gz to get more air to breathe
#