Added Repository Quota setting
This commit is contained in:
parent
755e313c61
commit
3a4f5a0394
10 changed files with 102 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue