From 52c9faa6f977cd50e54c1b8b33242a6c6a874ceb Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 7 Jul 2016 17:50:23 +0200 Subject: [PATCH] upgrade restore and backup scripts against pgsql --- app/urls.py | 2 +- scripts/backup_db.sh | 5 ++++- scripts/restore_db.sh | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) 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!" -- 2.39.5