fix: create directory if not exists

This commit is contained in:
Michael Reichenbach 2021-03-08 14:57:01 +01:00 committed by Silthus
parent 158506bc20
commit 12692193d5
1 changed files with 14 additions and 2 deletions

View File

@ -55,12 +55,18 @@ class MariadbContainer(Container):
def backup(self):
config = Config()
destination = self.backup_destination_path()
commands.run([
"mkdir",
"-p",
f"{destination}"
])
commands.run(self.dump_command())
return restic.backup_files(
config.repository,
self.backup_destination_path(),
destination,
tags=self.tags
)
@ -124,12 +130,18 @@ class MysqlContainer(Container):
def backup(self):
config = Config()
destination = self.backup_destination_path()
commands.run([
"mkdir",
"-p",
f"{destination}"
])
commands.run(self.dump_command())
return restic.backup_files(
config.repository,
self.backup_destination_path(),
destination,
tags=self.tags
)