diff --git a/management/backup.py b/management/backup.py index 4430103c..9101e28a 100755 --- a/management/backup.py +++ b/management/backup.py @@ -24,6 +24,10 @@ def backup_status(env): config = get_backup_config(env) now = datetime.datetime.now(dateutil.tz.tzlocal()) + # Are backups dissbled? + if config["target"] == "off": + return { } + backups = { } backup_cache_dir = os.path.join(backup_root, 'cache') @@ -174,6 +178,10 @@ def perform_backup(full_backup): backup_cache_dir = os.path.join(backup_root, 'cache') backup_dir = os.path.join(backup_root, 'encrypted') + # Are backups dissbled? + if config["target"] == "off": + return + # In an older version of this script, duplicity was called # such that it did not encrypt the backups it created (in # backup/duplicity), and instead openssl was called separately @@ -357,8 +365,8 @@ def backup_set_custom(env, target, target_user, target_pass, min_age): # Validate. try: - if config["target"] != "local": - # "local" isn't supported by the following function, which expects a full url in the target key, + if config["target"] not in ("off", "local"): + # these aren't supported by the following function, which expects a full url in the target key, # which is what is there except when loading the config prior to saving list_target_files(config) except ValueError as e: diff --git a/management/templates/system-backup.html b/management/templates/system-backup.html index 03eeb2c2..4c628629 100644 --- a/management/templates/system-backup.html +++ b/management/templates/system-backup.html @@ -14,6 +14,7 @@