Added Repository Quota setting

This commit is contained in:
Johannes Erwerle 2026-04-20 19:03:17 +02:00
parent 755e313c61
commit 3a4f5a0394
10 changed files with 102 additions and 2 deletions

View file

@ -34,8 +34,10 @@ def sync_repos(dry_run=False):
commands = []
for key, repositories in repos_by_key.items():
repo_paths = [f"--restrict-to-repository {repo.path}" for repo in repositories]
quota = max(repo.quota for repo in repositories)
ids = [str(repo.id) for repo in repositories]
commands.append(
f"""command="cd {str(settings.BACKUP_BORG_DIR)}; borg serve {" ".join(repo_paths)} --storage-quota=500G",restrict {key}"""
f"""command="cd {str(settings.BACKUP_BORG_DIR)}; borg serve {" ".join(repo_paths)} --storage-quota={quota}G;{settings.BACKUP_MANAGE_PY} update_used_quota --repository-id {" ".join(ids)}",restrict {key}"""
)
if not dry_run: