From cf5402fab2e4027c82713a476e21b9f833794152 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 13 Aug 2024 13:18:30 +0530 Subject: [PATCH] fix: set port while taking tablewise backup --- agent/site.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agent/site.py b/agent/site.py index 2e18f858..aeb4e618 100644 --- a/agent/site.py +++ b/agent/site.py @@ -496,6 +496,8 @@ def tablewise_backup(self): sort_keys=True, ) data = {"tables": {}} + db_port = self.config.get("db_port", 3306) + for table in tables: backup_file = os.path.join( self.backup_directory, f"{table}.sql.gz" @@ -504,7 +506,11 @@ def tablewise_backup(self): "set -o pipefail && " "mysqldump --single-transaction --quick --lock-tables=false " f"-h {self.host} -u {self.user} -p{self.password} " +<<<<<<< Updated upstream f"{self.database} -P {self.port} '{table}' " +======= + f"{self.database} -P {db_port} '{table}' " +>>>>>>> Stashed changes f" | gzip > '{backup_file}'", executable="/bin/bash", )