From 6e6f3cd38d0f589415ab71acd5c00d487f0b668e Mon Sep 17 00:00:00 2001 From: nemsia Date: Fri, 21 Apr 2017 14:29:37 +0200 Subject: Acl for Postgres user dump --- scripts/restore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index f754d81..80233af 100644 --- a/scripts/restore +++ b/scripts/restore @@ -81,6 +81,9 @@ sudo su -c "psql" postgres <<< \ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" +# Acl for Postgres user dump +sudo setfacl -R -m u:postgres:r $YNH_APP_BACKUP_DIR || true + # Restore db ynh_psql_create_db_without_password "$app" sudo su - postgres < Date: Tue, 25 Apr 2017 00:04:58 +0200 Subject: [fix] replace setfact by chmod --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index 80233af..a0498f0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" # Acl for Postgres user dump -sudo setfacl -R -m u:postgres:r $YNH_APP_BACKUP_DIR || true +sudo chmod o+r $YNH_APP_BACKUP_DIR/mastodon_db.sql || true # Restore db ynh_psql_create_db_without_password "$app" -- cgit v1.2.3-70-g09d2 From fadf3e03b9361e04d55ca738fdff8ce7a71ac906 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 25 Apr 2017 12:46:21 +0200 Subject: [fix] Chmod .sql --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index a0498f0..c7e380c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" # Acl for Postgres user dump -sudo chmod o+r $YNH_APP_BACKUP_DIR/mastodon_db.sql || true +sudo chmod a+rx $YNH_APP_BACKUP_DIR/mastodon_db.sql || true # Restore db ynh_psql_create_db_without_password "$app" -- cgit v1.2.3-70-g09d2 From d15d28745678bc9a9e9bf285988b83e3cb534bf4 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 25 Apr 2017 14:46:40 +0200 Subject: [fix] Acl backup directory --- scripts/restore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index c7e380c..414a5f5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,8 @@ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" # Acl for Postgres user dump -sudo chmod a+rx $YNH_APP_BACKUP_DIR/mastodon_db.sql || true +sudo chmod a+rx $YNH_APP_BACKUP_DIR +sudo chmod a+rx $YNH_APP_BACKUP_DIR/mastodon_db.sql # Restore db ynh_psql_create_db_without_password "$app" -- cgit v1.2.3-70-g09d2 From 5850d816620c8b6c1664f0c478321570591f9118 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 25 Apr 2017 21:21:11 +0200 Subject: [fix] Copy dump in $finalpath --- scripts/restore | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index 414a5f5..f931f0d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -81,16 +81,18 @@ sudo su -c "psql" postgres <<< \ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" -# Acl for Postgres user dump -sudo chmod a+rx $YNH_APP_BACKUP_DIR -sudo chmod a+rx $YNH_APP_BACKUP_DIR/mastodon_db.sql +# Copy postgresql dump +sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path # Restore db ynh_psql_create_db_without_password "$app" sudo su - postgres < Date: Wed, 26 Apr 2017 10:40:39 +0200 Subject: [fix] Chmod on backup/tmp --- scripts/restore | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index f931f0d..8d0df6a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,6 +70,8 @@ sudo cp -a ./sources "$final_path" # Set permissions sudo chown -R $app: "$final_path" +sudo chmod -R a+rx /home/yunohost.backup/tmp + # Set UTF8 encoding by default sudo su -c "psql" postgres <<< \ -- cgit v1.2.3-70-g09d2 From ed08bd31ad591bbae6fbd66f910ccf0d129738ef Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 26 Apr 2017 13:52:17 +0200 Subject: [fix] Add restart postgre --- scripts/restore | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index 8d0df6a..65a4af8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -88,6 +88,7 @@ sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path # Restore db ynh_psql_create_db_without_password "$app" +sudo systemctl restart postgresql sudo su - postgres < Date: Wed, 26 Apr 2017 16:12:34 +0200 Subject: [fix] PG restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index 65a4af8..7820e04 100644 --- a/scripts/restore +++ b/scripts/restore @@ -90,7 +90,7 @@ sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path ynh_psql_create_db_without_password "$app" sudo systemctl restart postgresql sudo su - postgres < Date: Sat, 29 Apr 2017 23:53:33 +0200 Subject: [fix] Restore with psql --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index 3f63380..965f6f0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -104,7 +104,7 @@ RAILS_ENV=production bin/bundle exec rails assets:precompile RCOMMANDS # restore database -sudo pg_dump mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql +sudo psql mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql # Create symlink for ruby sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true -- cgit v1.2.3-70-g09d2