OSDN Git Service

Fix errors during backup task. Fix #3785
authorAxilleas Pipinellis <axilleas@archlinux.gr>
Tue, 7 May 2013 06:14:03 +0000 (09:14 +0300)
committerAxilleas Pipinellis <axilleas@archlinux.gr>
Tue, 7 May 2013 11:44:49 +0000 (14:44 +0300)
By default there is no public/uploads directory when no attachments
are uploaded. Prompt users to create the uploads directory during
install otherwise the backup task will fail.

Place mysqldump args in single quotes to avoid error if password
contains special characters.

Signed-off-by: Axilleas Pipinellis <axilleas@archlinux.gr>
doc/install/installation.md
lib/backup/database.rb

index 9734034..19c613e 100644 (file)
@@ -169,6 +169,10 @@ do so with caution!
     sudo chmod -R u+rwX  tmp/pids/
     sudo chmod -R u+rwX  tmp/sockets/
 
+               # Create 'uploads' directory otherwise backup will fail
+    sudo -u git -H mkdir public/uploads
+    sudo chmod -R u+rwX  public/uploads
+
     # Copy the example Puma config
     sudo -u git -H cp config/puma.rb.example config/puma.rb
 
index cfa9971..2c43ed4 100644 (file)
@@ -45,7 +45,7 @@ module Backup
         'encoding'  => '--default-character-set',
         'password'  => '--password'
       }
-      args.map { |opt, arg| "#{arg}=#{config[opt]}" if config[opt] }.compact.join(' ')
+      args.map { |opt, arg| "#{arg}='#{config[opt]}'" if config[opt] }.compact.join(' ')
     end
 
     def pg_env