]> git.parisson.com Git - telemeta.git/commitdiff
use .init only for update_index, add DB backup and restore scripts
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 26 Jan 2016 10:24:20 +0000 (11:24 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 26 Jan 2016 10:24:20 +0000 (11:24 +0100)
.gitignore
app/deploy/start_app.sh
data/backup/backup_db.sh [new file with mode: 0755]
data/backup/restore_db.sh [new file with mode: 0755]

index ce93772b0aff770e930c57900e55bbf58b132023..78da6b0ffdfdd545eef067ea67ed445a08a08705 100644 (file)
@@ -10,7 +10,9 @@ eggs
 parts
 bin
 var
-data
+data/media
+data/var
+data/static
 sdist
 develop-eggs
 .installed.cfg
index 4b626e0a7fdc6a32d00f8c48a4c430502fa1a5ae..fc103355cf91c20bb828b87548cbc4f838a5cd13 100644 (file)
@@ -28,11 +28,11 @@ python $app/wait.py
 python $manage syncdb --noinput
 python $manage migrate --noinput
 python $manage collectstatic --noinput
+python $manage telemeta-create-admin-user
+python $manage telemeta-create-boilerplate
 
 if [ ! -f $app/.init ]; then
  chown -R www-data:www-data $media
- python $manage telemeta-create-admin-user
- python $manage telemeta-create-boilerplate
  python $manage update_index --workers $processes &
  touch $app/.init
 fi
diff --git a/data/backup/backup_db.sh b/data/backup/backup_db.sh
new file mode 100755 (executable)
index 0000000..b28c0f4
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+NOW=$(date +"%T-%m-%d-%Y")
+mysqldump -hdb -uroot -pmysecretpassword telemeta | gzip > /srv/backup/telemeta-$NOW.sql.gz
diff --git a/data/backup/restore_db.sh b/data/backup/restore_db.sh
new file mode 100755 (executable)
index 0000000..1bf4eb3
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+gunzip < /srv/backup/$1 | mysql -hdb -uroot -pmysecretpassword telemeta