@@ -184,6 +184,7 @@ def _list_backup_files(self, path: Path) -> Iterable[Path]:
184184 def _create_backup (
185185 self ,
186186 name : str ,
187+ filename : str | None ,
187188 sys_type : BackupType ,
188189 password : str | None ,
189190 compressed : bool = True ,
@@ -196,7 +197,11 @@ def _create_backup(
196197 """
197198 date_str = utcnow ().isoformat ()
198199 slug = create_slug (name , date_str )
199- tar_file = Path (self ._get_base_path (location ), f"{ slug } .tar" )
200+
201+ if filename :
202+ tar_file = Path (self ._get_base_path (location ), Path (filename ).name )
203+ else :
204+ tar_file = Path (self ._get_base_path (location ), f"{ slug } .tar" )
200205
201206 # init object
202207 backup = Backup (self .coresys , tar_file , slug , self ._get_location_name (location ))
@@ -482,6 +487,7 @@ async def _do_backup(
482487 async def do_backup_full (
483488 self ,
484489 name : str = "" ,
490+ filename : str | None = None ,
485491 * ,
486492 password : str | None = None ,
487493 compressed : bool = True ,
@@ -500,7 +506,7 @@ async def do_backup_full(
500506 )
501507
502508 backup = self ._create_backup (
503- name , BackupType .FULL , password , compressed , location , extra
509+ name , filename , BackupType .FULL , password , compressed , location , extra
504510 )
505511
506512 _LOGGER .info ("Creating new full backup with slug %s" , backup .slug )
@@ -526,6 +532,7 @@ async def do_backup_full(
526532 async def do_backup_partial (
527533 self ,
528534 name : str = "" ,
535+ filename : str | None = None ,
529536 * ,
530537 addons : list [str ] | None = None ,
531538 folders : list [str ] | None = None ,
@@ -558,7 +565,7 @@ async def do_backup_partial(
558565 _LOGGER .error ("Nothing to create backup for" )
559566
560567 backup = self ._create_backup (
561- name , BackupType .PARTIAL , password , compressed , location , extra
568+ name , filename , BackupType .PARTIAL , password , compressed , location , extra
562569 )
563570
564571 _LOGGER .info ("Creating new partial backup with slug %s" , backup .slug )
0 commit comments