Автосоздание папки для бекапов, если она отсутствует

This commit is contained in:
Llloooggg
2020-10-15 12:17:22 +03:00
parent 8a4471adb5
commit b4d1abb393

View File

@@ -3,12 +3,15 @@
from datetime import datetime
from subprocess import call
from shutil import rmtree
from os import scandir, makedirs, remove, rename
from os import path, makedirs, scandir, remove, rename
path_to_backups = "/mnt/bank/backups/"
dateFormat = "%H-%M-%S--%d-%m-%Y"
if not path.exists(f"{path_to_backups}"):
makedirs(f"{path_to_backups}")
all_objs = []
with scandir(path_to_backups) as dir_objs:
for obj in dir_objs: