-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: main
Are you sure you want to change the base?
Conversation
Second commit is what I believe will do full backups only if it is a weekend day or if |
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 |
management/backup.py
Outdated
try: | ||
full_backup = full_backup or should_force_full(config, env) | ||
full_backup = (full_backup and weekend) or should_force_full(config, env) |
There was a problem hiding this comment.
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:
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.