From 3198b11e26b9d47cf9951b842a3f751b1ecb48d6 Mon Sep 17 00:00:00 2001 From: Ruben Koster Date: Mon, 11 Dec 2017 20:26:58 +0100 Subject: [PATCH] Check for existence of postgres-previous (since OLD_STORE_DIR is not cleaned up) --- jobs/migrate-postgres/templates/pre-start.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jobs/migrate-postgres/templates/pre-start.erb b/jobs/migrate-postgres/templates/pre-start.erb index 4649e05..1df0dc4 100755 --- a/jobs/migrate-postgres/templates/pre-start.erb +++ b/jobs/migrate-postgres/templates/pre-start.erb @@ -3,8 +3,8 @@ OLD_STORE_DIR=/var/vcap/store/postgres-9.4 NEW_STORE_DIR=/var/vcap/store/postgres -if [ -d ${OLD_STORE_DIR} ]; then +if [ ! -d ${NEW_STORE_DIR}/postgres-previous ]; then mkdir -p ${NEW_STORE_DIR} ln -s ${OLD_STORE_DIR} ${NEW_STORE_DIR}/postgres-unknown /var/vcap/jobs/postgres/bin/pre-start -fi +fi