1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-23 02:27:05 +00:00

Revert "change to only do full backup on weekends"

This reverts commit e6ac40283d.
This commit is contained in:
Ted To 2024-08-15 13:17:52 -04:00
parent e6ac40283d
commit 0aa6ed0c8b

View File

@ -9,7 +9,6 @@
import os, os.path, re, datetime, sys import os, os.path, re, datetime, sys
import dateutil.parser, dateutil.relativedelta, dateutil.tz import dateutil.parser, dateutil.relativedelta, dateutil.tz
from datetime import date
import rtyaml import rtyaml
from exclusiveprocess import Lock from exclusiveprocess import Lock
@ -263,9 +262,6 @@ def get_target_type(config):
def perform_backup(full_backup): def perform_backup(full_backup):
env = load_environment() env = load_environment()
# Check if day of week is a weekend day
weekend = date.today().weekday()>=5
# Create an global exclusive lock so that the backup script # Create an global exclusive lock so that the backup script
# cannot be run more than one. # cannot be run more than one.
Lock(die=True).forever() Lock(die=True).forever()
@ -280,11 +276,11 @@ def perform_backup(full_backup):
return return
# On the first run, always do a full backup. Incremental # On the first run, always do a full backup. Incremental
# will fail. Otherwise do a full backup on weekends when # will fail. Otherwise do a full backup when the size of
# the size of the increments since the most recent full # the increments since the most recent full backup are
# backup are large. # large.
try: try:
full_backup = (full_backup and weekend) or should_force_full(config, env) full_backup = full_backup or should_force_full(config, env)
except Exception as e: except Exception as e:
# This was the first call to duplicity, and there might # This was the first call to duplicity, and there might
# be an error already. # be an error already.