From 0985ff8f9bc3ab02186cace3eafad5fd6f2cbdd9 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sun, 7 Dec 2014 22:46:57 +0100 Subject: [PATCH] Fixed script that imports data from the current live server --- bin/get-data-from-old-live-server.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/bin/get-data-from-old-live-server.sh b/bin/get-data-from-old-live-server.sh index 30b4d32..cd48b3a 100755 --- a/bin/get-data-from-old-live-server.sh +++ b/bin/get-data-from-old-live-server.sh @@ -1,25 +1,31 @@ -#!/bin/sh -e +#!/bin/sh -ex + +#IMAGE_DEST=../public +IMAGE_DEST=/local/screenshots +#DB_HOST=localhost +DB_HOST=torf echo Getting screenshot files -rsync -v root@screenshots.debian.net:/home/debshots/debshots-screenshots.tar /tmp/ +rsync -v root@screenshots.debian.net:/home/debshots/debshots-screenshots.tar /tmp echo Getting PostgreSQL dump rsync -v root@screenshots.debian.net:/home/debshots/debshots.sql /tmp echo Dropping existing database set +e -psql postgres debshots -c 'drop database debshots' +psql -h $DB_HOST postgres debshots -c 'drop database debshots' set -e echo Creating new database -psql postgres debshots -c 'create database debshots owner debshots' +psql -h $DB_HOST postgres debshots -c 'create database debshots owner debshots' echo Restoring PostgreSQL dump -psql debshots debshots < /tmp/debshots.sql +psql -h $DB_HOST debshots debshots < /tmp/debshots.sql echo Unpacking screenshots tarball -cd ../public +#cd ../public +cd $IMAGE_DEST tar xf /tmp/debshots-screenshots.tar -mv public/live/screenshots/approved public/screenshots -rm -r public/live +#mv public/live/screenshots/approved public/screenshots +#rm -r public/live