mirror of
https://github.com/Llloooggg/BackuPYer.git
synced 2026-03-06 10:36:23 +03:00
Автосоздание папки для бекапов, если она отсутствует
This commit is contained in:
@@ -3,12 +3,15 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from shutil import rmtree
|
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/"
|
path_to_backups = "/mnt/bank/backups/"
|
||||||
|
|
||||||
dateFormat = "%H-%M-%S--%d-%m-%Y"
|
dateFormat = "%H-%M-%S--%d-%m-%Y"
|
||||||
|
|
||||||
|
if not path.exists(f"{path_to_backups}"):
|
||||||
|
makedirs(f"{path_to_backups}")
|
||||||
|
|
||||||
all_objs = []
|
all_objs = []
|
||||||
with scandir(path_to_backups) as dir_objs:
|
with scandir(path_to_backups) as dir_objs:
|
||||||
for obj in dir_objs:
|
for obj in dir_objs:
|
||||||
|
|||||||
Reference in New Issue
Block a user