1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

feat(backups): a schedule also keeps weekly and monthly backups

Besides the newest N backups of each VM, a schedule keeps the newest backup
of each of the last N weeks and of the last N months that have one (panel
time zone); 0 keeps none. The schedules list shows them.
This commit is contained in:
catborise 2026-11-19 22:01:14 +03:00
parent adb4231db7
commit 2c0855cf64
13 changed files with 392 additions and 251 deletions

View file

@ -52,6 +52,9 @@ class BackupPolicy(models.Model):
tag = models.ForeignKey(Tag, on_delete=models.PROTECT, null=True, blank=True, related_name="backup_policies")
time = models.TimeField() # in the panel's time zone
keep = models.PositiveSmallIntegerField()
# also kept: the newest backup of each of the newest N weeks and months that have one (0: none)
keep_weekly = models.PositiveSmallIntegerField(default=0)
keep_monthly = models.PositiveSmallIntegerField(default=0)
full_every = models.PositiveSmallIntegerField(default=1) # a full backup every N; the others incremental
frozen = models.BooleanField(default=False)
enabled = models.BooleanField(default=True)