summaryrefslogtreecommitdiff
path: root/backup/drivers
diff options
context:
space:
mode:
authorLingxian Kong <anlin.kong@gmail.com>2020-09-08 23:03:34 +1200
committerLingxian Kong <anlin.kong@gmail.com>2020-09-11 13:48:32 +1200
commit5482c54645fcea2af6b61837e8ff78cd77e1810c (patch)
tree3f6d03006c6237ef9a4d864c6430aa6070394369 /backup/drivers
parent8761f327fe8e4fca55d8fd667f7b9cf279d29299 (diff)
downloadtrove-5482c54645fcea2af6b61837e8ff78cd77e1810c.tar.gz
[Postgresql] Create replica
Change-Id: Ia00032074dc44a6fbfc1e2d5ab16d1734a1a732c
Diffstat (limited to 'backup/drivers')
-rw-r--r--backup/drivers/innobackupex.py4
-rw-r--r--backup/drivers/mysql_base.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/backup/drivers/innobackupex.py b/backup/drivers/innobackupex.py
index 9bbebc3a..ff5446c7 100644
--- a/backup/drivers/innobackupex.py
+++ b/backup/drivers/innobackupex.py
@@ -42,7 +42,7 @@ class InnoBackupEx(mysql_base.MySQLBaseRunner):
cmd = ('innobackupex'
' --stream=xbstream'
' --parallel=2 ' +
- self.user_and_pass + ' %s' % self.default_data_dir +
+ self.user_and_pass + ' %s' % self.datadir +
' 2>' + self.backup_log
)
return cmd + self.zip_cmd + self.encrypt_cmd
@@ -111,7 +111,7 @@ class InnoBackupExIncremental(InnoBackupEx):
' --stream=xbstream'
' --incremental'
' --incremental-lsn=%(lsn)s ' +
- self.user_and_pass + ' %s' % self.default_data_dir +
+ self.user_and_pass + ' %s' % self.datadir +
' 2>' + self.backup_log)
return cmd + self.zip_cmd + self.encrypt_cmd
diff --git a/backup/drivers/mysql_base.py b/backup/drivers/mysql_base.py
index 6389cdb9..59c94bb0 100644
--- a/backup/drivers/mysql_base.py
+++ b/backup/drivers/mysql_base.py
@@ -53,7 +53,8 @@ class MySQLBaseRunner(base.BaseRunner):
last_line = output.splitlines()[-1].strip()
if not re.search('completed OK!', last_line):
- LOG.error("Backup did not complete successfully.")
+ LOG.error(f"Backup did not complete successfully, last line:\n"
+ f"{last_line}")
return False
return True