Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change hour of daily tasks to run at 1am #2424

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

zoof
Copy link

@zoof zoof commented Aug 9, 2024

With large amounts of email, full backups can take a lot of time. This PR addresses the first option suggested from https://discourse.mailinabox.email/t/full-backups-taking-a-long-time/12242.

@zoof
Copy link
Author

zoof commented Aug 13, 2024

Second commit is what I believe will do full backups only if it is a weekend day or if should_force_full returns True. Short of spinning up a new VPS, it is not possible for me to test.

@kiekerjan
Copy link
Contributor

I don't think it works like that. The variable full_backup is only set to True when backup.py is called with "--full". You should look at should_force_full

try:
full_backup = full_backup or should_force_full(config, env)
full_backup = (full_backup and weekend) or should_force_full(config, env)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @kiekerjan is right, so it should probably be:

Suggested change
full_backup = (full_backup and weekend) or should_force_full(config, env)
full_backup = full_backup or (weekend and should_force_full(config, env))

By doing it weekend and ..., if weekend is false it won't even check if it should (via should_force_full). should_force_full scans the existing backup to see it's state and may be somewhat slow, so avoiding it on non-weekend days would be nice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is that should_force_full also checks if there are no full backups. If in that case weekend = False, the backup will fail, as an incremental backup will be tried.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I made changes to should_force_full instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants