From fef784ba886dc3a2611a0621b29ce3a53d35c6f5 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Sat, 7 Jan 2023 18:23:22 +0100 Subject: [PATCH] fix: better rfc complient filters --- backup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backup.py b/backup.py index 590f6ff..04f7d37 100644 --- a/backup.py +++ b/backup.py @@ -48,7 +48,15 @@ def createBackupScriptStructure(backupList, baseDomain=""): print("WARNING: Root (/) is not allowed as backup path (skipping..)".format(p)) continue else: - basePaths.append("/{}/".format(cur.split("/")[1])) + tmpPath = "/" + for level in cur.split("/")[:-2]: + if not level: + continue + else: + tmpPath += "{}/".format(level) + if not tmpPath == "/": + basePaths.append(tmpPath) + fullPaths.append(cur) # keep order (important!)