diff --git a/backup.py b/backup.py index 1d03c59..810dfaf 100644 --- a/backup.py +++ b/backup.py @@ -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: