From 48d5995a2abb0cff1179f8732938954da2fa2ed7 Mon Sep 17 00:00:00 2001 From: IDK Date: Wed, 18 Aug 2021 13:11:03 +0200 Subject: [PATCH] =?UTF-8?q?Script=20export=20donn=C3=A9es=20pour=20ScoDoc?= =?UTF-8?q?=209?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/save_scodoc7_data.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/save_scodoc7_data.sh b/config/save_scodoc7_data.sh index 75308382..eac6ebe1 100755 --- a/config/save_scodoc7_data.sh +++ b/config/save_scodoc7_data.sh @@ -44,12 +44,13 @@ scodocctl stop echo "Dumping SQL databases..." chown postgres "$DEST" -for cfgfile in "$SCODOC_VAR_DIR"/config/depts/*cfg +for cfgfile in "$INSTANCE_DIR"/var/scodoc/config/depts/*cfg USERS do + cfgfile=$(basename "$cfgfile") dept="${cfgfile%*.cfg}" db_name="SCO$dept" echo "$db_name" - su -c "pg_dump --format=custom --file=\"$DEST/$db_name.dump\" \"$db_name\"" + su -c "pg_dump --format=custom --file=\"$DEST/$db_name.dump\" \"$db_name\"" postgres if [ ! "$?" -eq 0 ] then printf "Error dumping postgresql database\nPlease check that SQL server is running\nAborting."