From bfc7405e883f9fc34458a5d02131d8a0d5102ff3 Mon Sep 17 00:00:00 2001
From: Simon Michnowicz <simon.michnowicz@monash.edu>
Date: Wed, 13 Mar 2019 17:54:20 +1100
Subject: [PATCH] modified for new architecture

Former-commit-id: c1428d9d95950d1863fe527993ee8cbe6a1a1ed8
---
 .../templates/backup_mysql_for_slurm.sh.j2           | 12 ++++++------
 roles/slurm_sql_bk/templates/mysql.conf.j2           |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/roles/slurm_sql_bk/templates/backup_mysql_for_slurm.sh.j2 b/roles/slurm_sql_bk/templates/backup_mysql_for_slurm.sh.j2
index 8b5c9cdc..55dc58fa 100644
--- a/roles/slurm_sql_bk/templates/backup_mysql_for_slurm.sh.j2
+++ b/roles/slurm_sql_bk/templates/backup_mysql_for_slurm.sh.j2
@@ -1,17 +1,17 @@
 #!/bin/sh
 #
 # mysql dump for slurm. 
-# S.Michnowicz
-# 20/Jan/2016
 #
 
 TIME=$(date '+%y-%m-%d')
-DIR={{ SQL_BK_DIR }}
-NAME="$DIR/mysql_dump_20${TIME}.sql"
+BIN_DIR={{ MGMT_BIN_DIR }}
+DATA_DIR={{ SQL_BK_DATA_DIR }}
+NAME="$DATA_DIR/mysql_dump_20${TIME}.sql"
 
-sudo mysqldump  --defaults-file=$DIR/mysql.conf   slurm_acct_db > $NAME
+cd $DATA_DIR
+sudo mysqldump --defaults-file=$BIN_DIR/mysql.conf --host={{ SQL_IP }}   slurm_acct_db > $NAME
 sudo chmod go-r $NAME
 sudo gzip -f $NAME
 #scp file to   dummy user @ Destination Node and Directory
-scp ${NAME}.gz  {{ SQL_USER }}@{{ SQL_BK_DEST_HOST }}:{{ SQL_BK_DEST_DIR }}
+scp -i ~/.ssh/slm_db_backup ${NAME}.gz  {{ SQL_USER }}@{{ SQL_BK_DEST_HOST }}:{{ SQL_BK_DEST_DIR }}
 rm -f  ${NAME}.gz 
diff --git a/roles/slurm_sql_bk/templates/mysql.conf.j2 b/roles/slurm_sql_bk/templates/mysql.conf.j2
index ea91192c..33242926 100644
--- a/roles/slurm_sql_bk/templates/mysql.conf.j2
+++ b/roles/slurm_sql_bk/templates/mysql.conf.j2
@@ -1,3 +1,3 @@
 [client]
-password="{{ sqlrootPasswd }}"
-user=root
+password="{{ sqlPasswd }}"
+user="{{ sqlUsername }}"
-- 
GitLab