]> git.parisson.com Git - mezzo.git/commitdiff
upgrade restore and backup scripts against pgsql
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 7 Jul 2016 15:50:23 +0000 (17:50 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 7 Jul 2016 15:50:23 +0000 (17:50 +0200)
app/urls.py
scripts/backup_db.sh
scripts/restore_db.sh

index 10df47ebb3ec53d94f45ff8a0e9142fe20c09db3..1a913527eefb4dc94eef2ef496a57c8aeb9b340a 100644 (file)
@@ -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
     # ---------------------------------------------
index 43b57a3fe26ae6bbb69652accac7952b24bb0671..35b7e2f58799d928b316240cf568406ce9d8a5fe 100755 (executable)
@@ -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!"
index 559caac449e85c4897cb0d60f6f705d88ec88d93..ad8f18bf44f73ab45fe5766d72caa39d05281837 100755 (executable)
@@ -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!"