From: Guillaume Pellerin Date: Thu, 7 Jul 2016 15:50:23 +0000 (+0200) Subject: upgrade restore and backup scripts against pgsql X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=52c9faa6f977cd50e54c1b8b33242a6c6a874ceb;p=mezzo.git upgrade restore and backup scripts against pgsql --- diff --git a/app/urls.py b/app/urls.py index 10df47eb..1a913527 100644 --- a/app/urls.py +++ b/app/urls.py @@ -41,7 +41,7 @@ urlpatterns += [ # one out. url("^styles/$", direct_to_template, {"template": "styles.html"}, name="styles"), - url("^$", direct_to_template, {"template": "index.html"}, name="home"), + url("^$", HomeView.as_view(), name="home"), # HOMEPAGE AS AN EDITABLE PAGE IN THE PAGE TREE # --------------------------------------------- diff --git a/scripts/backup_db.sh b/scripts/backup_db.sh index 43b57a3f..35b7e2f5 100755 --- a/scripts/backup_db.sh +++ b/scripts/backup_db.sh @@ -1,4 +1,7 @@ #!/bin/bash -mysqldump -hdb -uroot -phyRob0otlaz4 ircam-www | gzip > /srv/backup/ircam-www.sql.gz +export PGPASSWORD=$POSTGRES_PASSWORD + +pg_dump -Fc -hdb -Upostgres -dpostgres > /srv/backup/ircam-www.dump + echo "Backup done!" diff --git a/scripts/restore_db.sh b/scripts/restore_db.sh index 559caac4..ad8f18bf 100755 --- a/scripts/restore_db.sh +++ b/scripts/restore_db.sh @@ -1,4 +1,7 @@ #!/bin/bash -gunzip < /srv/backup/ircam-www.sql.gz | mysql -hdb -uroot -phyRob0otlaz4 ircam-www +export PGPASSWORD=$POSTGRES_PASSWORD + +pg_restore --clean -Fc -hdb -Upostgres -d postgres /srv/backup/ircam-www.dump + echo "Restore done!"