Skip to content

should_force_full() threshold in backup.py may be suboptimal for low-volume mail servers #2579

@snrkl

Description

@snrkl

should_force_full() threshold may be suboptimal for low-volume mail servers

Environment:

  • Mail-in-a-Box v73
  • Ubuntu 22.04
  • S3 backup target

Description:

should_force_full() seems to trigger a full backup on weekends only when cumulative incremental size exceeds 50% of the last full backup. On low-volume mail servers where daily incrementals are small relative to the full backup size, this threshold may never be reached in practice. Without a time-based fallback, the incremental chain can grow indefinitely against an increasingly old full backup.

Steps to reproduce:

  1. Configure MIAB with S3 backup target on a low-volume mail server
  2. Allow backups to run for an extended period
  3. Observe that no full backup is triggered automatically despite the incremental chain growing over time

Potential fix:

In management/backup.py, should_force_full() around line 166:

 		if weekend:
 			if inc_size > .5*bak["size"]:
 				return True
+			if first_full_date + datetime.timedelta(days=90) < datetime.datetime.now(dateutil.tz.tzlocal()):
+				return True
 		return False

It would be helpful if the specific threshold value could be user-configurable. Ideally though the UI, or potentially through a custom.yaml for power users.

It is noted that:

  • a custom YAML config likely goes against the design principles of the project
  • The use case for smaller volume mail systems also likely occurs more with implementations that do not have significant engineering support to deploy 'under the hood' customisations, so a userland backup setting for "force full backup every N" might be an appropriate solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions