The Samba-Bugzilla – Attachment 18614 Details for
Bug 15661
Online backup fails when smb over tcp is missing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git format-patch patch
0001-samba-tool-domain-backup-add-no-sysvol-option.patch (text/plain), 2.82 KB, created by
Douglas Bagnall
on 2025-03-19 01:51:13 UTC
(
hide
)
Description:
git format-patch patch
Filename:
MIME Type:
Creator:
Douglas Bagnall
Created:
2025-03-19 01:51:13 UTC
Size:
2.82 KB
patch
obsolete
>From 1273fc01350376233df77a0dca76d636c682c630 Mon Sep 17 00:00:00 2001 >From: Thomas Karlsson <thomas.karlsson@relea.se> >Date: Wed, 19 Mar 2025 14:40:22 +1300 >Subject: [PATCH] samba-tool domain backup: add --no-sysvol option > >In some circumstances sysvol is not wanted in a backup. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15661 > >Signed-off-by: Thomas Karlsson <thomas.karlsson@relea.se> >--- > python/samba/netcmd/domain/backup.py | 22 +++++++++++++--------- > 1 file changed, 13 insertions(+), 9 deletions(-) > >diff --git a/python/samba/netcmd/domain/backup.py b/python/samba/netcmd/domain/backup.py >index a72c6daaded..1769909fb93 100644 >--- a/python/samba/netcmd/domain/backup.py >+++ b/python/samba/netcmd/domain/backup.py >@@ -246,10 +246,13 @@ class cmd_domain_backup_online(samba.netcmd.Command): > choices=["tdb", "mdb"], > help="Specify the database backend to be used " > "(default is %s)" % get_default_backend_store()), >+ Option("--no-sysvol", action="store_true", default=False, >+ help="Exclude sysvol from the backup created"), >+ > ] > > def run(self, sambaopts=None, credopts=None, server=None, targetdir=None, >- no_secrets=False, backend_store=None): >+ no_secrets=False, backend_store=None, no_sysvol=False): > logger = self.get_logger() > logger.setLevel(logging.DEBUG) > >@@ -282,15 +285,16 @@ class cmd_domain_backup_online(samba.netcmd.Command): > new_sid = get_sid_for_restore(remote_sam, logger) > realm = remote_sam.domain_dns_name() > >- # Grab the remote DC's sysvol files and bundle them into a tar file >- logger.info("Backing up sysvol files (via SMB)...") >- sysvol_tar = os.path.join(tmpdir, 'sysvol.tar.gz') >- smb_conn = smb_sysvol_conn(server, lp, creds) >- backup_online(smb_conn, sysvol_tar, remote_sam.get_domain_sid()) >+ if not no_sysvol: >+ # Grab the remote DC's sysvol files and bundle them into a tar file >+ logger.info("Backing up sysvol files (via SMB)...") >+ sysvol_tar = os.path.join(tmpdir, 'sysvol.tar.gz') >+ smb_conn = smb_sysvol_conn(server, lp, creds) >+ backup_online(smb_conn, sysvol_tar, remote_sam.get_domain_sid()) > >- # remove the default sysvol files created by the clone (we want to >- # make sure we restore the sysvol.tar.gz files instead) >- shutil.rmtree(paths.sysvol) >+ # remove the default sysvol files created by the clone (we want to >+ # make sure we restore the sysvol.tar.gz files instead) >+ shutil.rmtree(paths.sysvol) > > # Edit the downloaded sam.ldb to mark it as a backup > samdb = SamDB(url=paths.samdb, session_info=system_session(), lp=lp, >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15661
:
18339
|
18364
|
18592
| 18614