summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Siraut <csiraut@entrouvert.com>2020-03-26 15:21:34 (GMT)
committerChristophe Siraut <csiraut@entrouvert.com>2020-03-26 15:28:56 (GMT)
commit76b96d5ac3cb3971d12c11ee563053efda73ba20 (patch)
tree78be084df7194bad2cce36ac1e4c7f9b3a33162f
parentb94e74e17147c9f43b8c0458de19d6ff8b3f7d9b (diff)
downloadpublik-client-scripts-76b96d5ac3cb3971d12c11ee563053efda73ba20.zip
publik-client-scripts-76b96d5ac3cb3971d12c11ee563053efda73ba20.tar.gz
publik-client-scripts-76b96d5ac3cb3971d12c11ee563053efda73ba20.tar.bz2
montpellier/pg_copy_bijoe_schemas: execute on primary database (#41032)v1.13
-rwxr-xr-xclients/montpellier/pg_copy_bijoe_schemas.task4
1 files changed, 2 insertions, 2 deletions
diff --git a/clients/montpellier/pg_copy_bijoe_schemas.task b/clients/montpellier/pg_copy_bijoe_schemas.task
index 43a032c..e8d74e5 100755
--- a/clients/montpellier/pg_copy_bijoe_schemas.task
+++ b/clients/montpellier/pg_copy_bijoe_schemas.task
@@ -1,4 +1,4 @@
#! /bin/sh
+test $(echo 'database.node1.test.saas.entrouvert.org database.node2.test.saas.entrouvert.org database.node1.prod.saas.entrouvert.org database.node2.prod.saas.entrouvert.org' | xargs -n1 echo | grep -w `hostname -f`) || exit
-test `hostname -f` = 'database.node1.test.saas.entrouvert.org' && /usr/lib/publik/clients/montpellier/pg_copy_bijoe_schemas
-test `hostname -f` = 'database.node1.prod.saas.entrouvert.org' && /usr/lib/publik/clients/montpellier/pg_copy_bijoe_schemas
+test "$(sudo -u postgres psql -tAc 'SELECT pg_is_in_recovery();')" == 'f' && /usr/lib/publik/clients/montpellier/pg_copy_bijoe_schemas