Commit 4d259b30040eb3b92f60de72b76e61b6781b2a91
1 parent
7bdbfc12
Exists in
master
and in
79 other branches
Noosfero: Apply new patch for backup task
Signed-off-by: Athos Ribeiro <athoscribeiro@gmail.com> Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com>
Showing
2 changed files
with
55 additions
and
1 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | +From 3b814b256441be6e0fc98cb1afa695c4f13d6849 Mon Sep 17 00:00:00 2001 | |
| 2 | +From: Athos Ribeiro <athoscribeiro@gmail.com> | |
| 3 | +Date: Fri, 8 May 2015 15:13:40 -0300 | |
| 4 | +Subject: [PATCH] Fix backup task | |
| 5 | + | |
| 6 | +- Adds host option to the postgres commands where necessary. | |
| 7 | +- Passes -h option to tar when compressing in order to follow symlinks. | |
| 8 | + | |
| 9 | +Signed-off-by: Athos Ribeiro <athoscribeiro@gmail.com> | |
| 10 | +Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com> | |
| 11 | +--- | |
| 12 | + lib/tasks/backup.rake | 10 ++++++---- | |
| 13 | + 1 file changed, 6 insertions(+), 4 deletions(-) | |
| 14 | + | |
| 15 | +diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake | |
| 16 | +index 7e64d17..14b2418 100644 | |
| 17 | +--- a/lib/tasks/backup.rake | |
| 18 | ++++ b/lib/tasks/backup.rake | |
| 19 | +@@ -25,9 +25,10 @@ task :backup => :check_backup_support do | |
| 20 | + dump = File.join('tmp/backup', backup_name) + '.sql' | |
| 21 | + | |
| 22 | + database = $config['production']['database'] | |
| 23 | +- sh "pg_dump #{database} > #{dump}" | |
| 24 | ++ host = $config['production']['host'] | |
| 25 | ++ sh "pg_dump -h #{host} #{database} > #{dump}" | |
| 26 | + | |
| 27 | +- sh 'tar', 'caf', backup_file, dump, *dirs | |
| 28 | ++ sh 'tar', 'chaf', backup_file, dump, *dirs | |
| 29 | + rm_f dump | |
| 30 | + | |
| 31 | + puts "****************************************************" | |
| 32 | +@@ -81,14 +82,15 @@ task :restore => :check_backup_support do | |
| 33 | + | |
| 34 | + database = $config['production']['database'] | |
| 35 | + username = $config['production']['username'] | |
| 36 | ++ host = $config['production']['host'] | |
| 37 | + | |
| 38 | + puts "WARNING: backups should be restored to an empty database, otherwise" | |
| 39 | + puts "data from the backup may not be loaded properly." | |
| 40 | + puts | |
| 41 | + puts 'You can remove the existing database and create a new one with:' | |
| 42 | + puts | |
| 43 | +- puts "$ sudo -u postgres dropdb #{database}" | |
| 44 | +- puts "$ sudo -u postgres createdb #{database} --owner #{username}" | |
| 45 | ++ puts "$ sudo -u postgres dropdb -h #{host} #{database}" | |
| 46 | ++ puts "$ sudo -u postgres createdb -h #{host} #{database} --owner #{username}" | |
| 47 | + puts | |
| 48 | + print "Are you sure you want to continue (y/N)? " | |
| 49 | + response = $stdin.gets.strip | |
| 50 | +-- | |
| 51 | +2.1.0 | |
| 52 | + | ... | ... |
specs/noosfero/noosfero.spec
| 1 | 1 | %define writable_dirs javascripts/cache stylesheets/cache articles image_uploads thumbnails |
| 2 | 2 | |
| 3 | 3 | Name: noosfero |
| 4 | -Version: 1.1~rc2.4 | |
| 4 | +Version: 1.1~rc2.5 | |
| 5 | 5 | Release: 2%{?dist} |
| 6 | 6 | Summary: Social Networking Platform |
| 7 | 7 | Group: Applications/Publishing |
| ... | ... | @@ -10,6 +10,7 @@ URL: http://noosfero.org |
| 10 | 10 | Source0: %{name}-%{version}.tar.gz |
| 11 | 11 | Patch0: 0001-Use-as-placeholder-for-current-user-in-URLs.patch |
| 12 | 12 | Patch1: 0001-Enhance-existing-backup-task-and-add-a-restore-one.patch |
| 13 | +Patch2: 0001-Fix-backup-task.patch | |
| 13 | 14 | BuildArch: noarch |
| 14 | 15 | BuildRequires: noosfero-deps, gettext, po4a |
| 15 | 16 | Requires: noosfero-deps, po4a, tango-icon-theme, memcached |
| ... | ... | @@ -25,6 +26,7 @@ participate and contribute to this free software project! |
| 25 | 26 | |
| 26 | 27 | %patch0 -p1 |
| 27 | 28 | %patch1 -p1 |
| 29 | +%patch2 -p1 | |
| 28 | 30 | |
| 29 | 31 | %build |
| 30 | 32 | ... | ... |