[fix] Quota and encryption on borg repo

This commit is contained in:
ljf 2022-10-10 15:28:45 +02:00
parent b6f2ec7a57
commit 533ed0ce47
No known key found for this signature in database

View file

@ -112,10 +112,12 @@ class BorgBackupRepository(LocalBackupRepository):
super().install() super().install()
# Initialize borg repo # Initialize borg repo
cmd = ["borg", "init", "--encryption", "repokey", self.location] encryption_mode = "repokey" if "passphrase" in self.future_values and self.future_values["passphrase"] else "none"
cmd = ["borg", "init", "--encryption", encryption_mode, self.location]
if "quota" in self.future_values: if "quota" in self.future_values and self.future_values["quota"]:
cmd += ['--storage-quota', self.quota] cmd += ['--storage-quota', self.quota]
self._call('init', cmd) self._call('init', cmd)
def update(self): def update(self):