From 2f578fd2c20ce5e92c45946c4b944f3d125f1748 Mon Sep 17 00:00:00 2001 From: nemsia Date: Sun, 30 Apr 2017 23:49:00 +0200 Subject: [PATCH] [fix] Restore db with mastodon user --- scripts/restore | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/restore b/scripts/restore index 965f6f0..63ce6ee 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,9 +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 - +# Debug sudo ls -alh "$final_path" # Change directory for create user & database postgresql @@ -104,7 +103,16 @@ RAILS_ENV=production bin/bundle exec rails assets:precompile RCOMMANDS # restore database -sudo psql mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql +sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path + +sudo su - $app <