From b4d1abb39311e244584a62d0e59a08b10a48b5aa Mon Sep 17 00:00:00 2001 From: Llloooggg Date: Thu, 15 Oct 2020 12:17:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=90=D0=B2=D1=82=D0=BE=D1=81=D0=BE=D0=B7?= =?UTF-8?q?=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B0=D0=BF=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=B1=D0=B5=D0=BA=D0=B0=D0=BF=D0=BE?= =?UTF-8?q?=D0=B2,=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=BE=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81=D1=82=D0=B2=D1=83=D0=B5?= =?UTF-8?q?=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: