]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool backup restore: cope with no sysvol
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 26 Mar 2025 02:55:33 +0000 (15:55 +1300)
committerRalph Boehme <slow@samba.org>
Sat, 29 Mar 2025 08:25:39 +0000 (08:25 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15661
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Mar 29 08:25:39 UTC 2025 on atb-devel-224

python/samba/netcmd/domain/backup.py

index 1769909fb93342befbbefe9abe04a0e3cb3262ec..5ad9987eec6e89c5b57537455e73386b80f4707b 100644 (file)
@@ -691,8 +691,11 @@ class cmd_domain_backup_restore(cmd_fsmo_seize):
         dest_sysvol_dir = lp.get('path', 'sysvol')
         if not os.path.exists(dest_sysvol_dir):
             os.makedirs(dest_sysvol_dir)
-        backup_restore(sysvol_tar, dest_sysvol_dir, samdb, smbconf)
-        os.remove(sysvol_tar)
+        if os.path.isfile(sysvol_tar):
+            backup_restore(sysvol_tar, dest_sysvol_dir, samdb, smbconf)
+            os.remove(sysvol_tar)
+        else:
+            logger.notice("back-up has no sysvol data")
 
         # fix up any stale links to the old DCs we just removed
         logger.info("Fixing up any remaining references to the old DCs...")