mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-12-14 09:52:21 +00:00
fix: create directory if not exists
This commit is contained in:
committed by
Silthus
parent
158506bc20
commit
12692193d5
@@ -55,12 +55,18 @@ class MariadbContainer(Container):
|
|||||||
|
|
||||||
def backup(self):
|
def backup(self):
|
||||||
config = Config()
|
config = Config()
|
||||||
|
destination = self.backup_destination_path()
|
||||||
|
|
||||||
|
commands.run([
|
||||||
|
"mkdir",
|
||||||
|
"-p",
|
||||||
|
f"{destination}"
|
||||||
|
])
|
||||||
commands.run(self.dump_command())
|
commands.run(self.dump_command())
|
||||||
|
|
||||||
return restic.backup_files(
|
return restic.backup_files(
|
||||||
config.repository,
|
config.repository,
|
||||||
self.backup_destination_path(),
|
destination,
|
||||||
tags=self.tags
|
tags=self.tags
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -124,12 +130,18 @@ class MysqlContainer(Container):
|
|||||||
|
|
||||||
def backup(self):
|
def backup(self):
|
||||||
config = Config()
|
config = Config()
|
||||||
|
destination = self.backup_destination_path()
|
||||||
|
|
||||||
|
commands.run([
|
||||||
|
"mkdir",
|
||||||
|
"-p",
|
||||||
|
f"{destination}"
|
||||||
|
])
|
||||||
commands.run(self.dump_command())
|
commands.run(self.dump_command())
|
||||||
|
|
||||||
return restic.backup_files(
|
return restic.backup_files(
|
||||||
config.repository,
|
config.repository,
|
||||||
self.backup_destination_path(),
|
destination,
|
||||||
tags=self.tags
|
tags=self.tags
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user