Skip to content

Commit

Permalink
fix: set port while taking tablewise backup
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh6790 committed Aug 13, 2024
1 parent 0f3a26f commit cf5402f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
)
Expand Down

0 comments on commit cf5402f

Please sign in to comment.