diff options
| author | nemsia <nemsia@nemsia.org> | 2017-04-25 21:21:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-25 21:21:11 +0200 |
| commit | 5850d816620c8b6c1664f0c478321570591f9118 (patch) | |
| tree | 59b29879b8933dde3a6c495437baa882e795d940 /scripts | |
| parent | d15d28745678bc9a9e9bf285988b83e3cb534bf4 (diff) | |
| download | mastodon_ynh-5850d816620c8b6c1664f0c478321570591f9118.tar.gz mastodon_ynh-5850d816620c8b6c1664f0c478321570591f9118.tar.bz2 mastodon_ynh-5850d816620c8b6c1664f0c478321570591f9118.zip | |
[fix] Copy dump in $finalpath
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/restore | 10 |
1 files changed, 6 insertions, 4 deletions
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 <<COMMANDS -pg_dump --role=mastodon -U postgres --no-password mastodon < $YNH_APP_BACKUP_DIR/mastodon_db.sql +pg_dump --role=mastodon -U postgres --no-password mastodon < $final_path/mastodon_db.sql COMMANDS +# Delete dump after restore +# rm $final_path/mastodon_db.sql + # Create symlink for ruby sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true |
