Stephen
2019-Apr-16 13:35 UTC
[Samba] samba-backup.sh problems - is the /var/lib/samba/etc folder essential in a Samba installation?
Hi everyone, I am running Samba 4.5.16-Debian on Raspbian OS and I am currently attempting to deploy the provided samba-backup.sh script within my existing SAMBA installation to implement disaster recovery on my AD DC servers. Following the documentation provided here https://wiki.samba.org/index.php/Using_the_samba_backup_script I have so far managed a partial success on my backup: pi at ad1:~ $ sudo /usr/sbin/samba_backup.sh tar: ./private: file changed as we read it tar: Cowardly refusing to create an empty archive Try 'tar --help' or 'tar --usage' for more information. Error while archiving /usr/local/backups/etc.2019-04-16.tar.bz2 - status = 2 The script aborts with status 2 which is apparently an unrecoverable fatal error. If I now do a quick ls we can examine what the script did manage to backup prior to it failing: pi at ad1:~ $ sudo ls /usr/local/backups samba4_private.2019-04-16.tar.bz2 So we can see that at least ONE of the THREE expected archives has been created which is a good start. When I examine samba_backup.sh I notice the following line in the script DIRS="private etc sysvol" which appears to just be a list of all the directories within /var/lib/samba to include within the backup. However when I do a quick ls, I notice am completely lacking the specified etc directory within my Samba installation - this is why the backup appears to be failing. The folder /var/lib/samba/etc doesn't exist on my machine: pi at ad1:~ $ sudo ls /var/lib/samba account_policy.tdb group_mapping.tdb ntp_signd printers private registry.tdb share_info.tdb sysvol usershares winbindd_cache.tdb winbindd_privileged So my questions are: 1) Should /var/lib/samba/etc folder exist in my installation? Should I worry that my installation botched since I appear to be missing it. 2) Related to 1, does /var/lib/samba/etc actually exist, perhaps the Debian/Raspbian packagers have moved it somewhere else? Alternatively it may be that the etc folder is actually optional and created on demand as needed? 3) Related to points 1 and 2 - Is it absolutely essential to include the contents of /var/lib/samba/etc in order to have a viable AD DC backup set (as per the current Samba docs)? If not I am just tempted to solve the problem by editing the aforementioned DIRS statement in order to to skip the backup on the etc folder since it doesn't exist on my machine. Kind Regards Stephen Ellwood
Stephen
2019-Apr-16 13:39 UTC
[Samba] samba-backup.sh problems - is the /var/lib/samba/etc folder essential in a Samba installation?
Further to my previous post, I have listed the contents of the tar file created during the backup. It appears to have a sensible bunch of files in it which makes me think the backup script is actually working properly, and I just have a path issue with my instalation here: pi at ad1:~ $ sudo tar -tf /usr/local/backups/samba4_private.2019-04-16.tar.bz2 ./private/ ./private/secrets.ldb ./private/secrets.ldb ./private/secrets.keytab ./private/privilege.ldb ./private/share.ldb ./private/hklm.ldb ./private/ldap_priv/ ./private/sam.ldb.d/ ./private/sam.ldb.d/metadata.tdb ./private/sam.ldb.d/DC=FORESTDNSZONES,DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/CN=CONFIGURATION,DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/CN=SCHEMA,CN=CONFIGURATION,DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/CN=SCHEMA,CN=CONFIGURATION,DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/DC=DOMAINDNSZONES,DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/CN=CONFIGURATION,DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/DC=DOMAINDNSZONES,DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/DC=FORESTDNSZONES,DC=OSSL,DC=COM.ldb ./private/sam.ldb.d/DC=OSSL,DC=COM.ldb ./private/tls/ ./private/tls/key.pem ./private/tls/cert.pem ./private/dns_update_cache ./private/share.ldb ./private/smbd.tmp/ ./private/privilege.ldb ./private/idmap.ldb ./private/spn_update_list ./private/idmap.ldb ./private/dns_update_list ./private/hklm.ldb ./private/krb5.conf ./private/secrets.tdb ./private/netlogon_creds_cli.tdb ./private/passdb.tdb ./private/rsyncd.secret ./private/sam.ldb ./private/named.conf.update ./private/sam.ldb ./private/msg.sock/ ./private/schannel_store.tdb Thanks Stephen Ellwood
Rowland Penny
2019-Apr-16 13:54 UTC
[Samba] samba-backup.sh problems - is the /var/lib/samba/etc folder essential in a Samba installation?
On Tue, 16 Apr 2019 14:39:49 +0100 Stephen via samba <samba at lists.samba.org> wrote:> Further to my previous post, I have listed the contents of the tar > file created during the backup. >The bash script you are using is only meant to be used with a self compiled version of Samba, where everything is meant to be in /usr/local/samba You will find a better script here: https://github.com/thctlo/samba4/tree/master/backup-script However, you really need to upgrade to a later, supported version of Samba, Samba supported versions are 4.8.x, 4.9.x and 4.10.x Rowland
Reasonably Related Threads
- samba-backup.sh problems - is the /var/lib/samba/etc folder essential in a Samba installation?
- Difficulties retrieving randomly assigned password for newly created Samba user acounts
- smbd fails to start after upgrade to version 4.11.6
- Enabling LDAPS in Samba in a dual-DC setup
- No DNS domain configured