[Samba] Recommended backup procedure for standalone samba file server configuration?

Stephen stephen at ogdenradar.com
Thu Feb 20 16:27:13 UTC 2020


Hi everyone, I am running Ubuntu 18.04 Bionic with Samba version 
4.7.6-Ubuntu.

*Background / Problem Context*

I have recently setup a server where I wish to use a standalone Samba 
file server in conjunction with SVN and git and then have all these 
services share the same username and password credentials. I wish to 
achieve this without using any centralised LDAP or Active Directory or 
similar nameservices for the time being.

My overall approach is very simple - I basically have a script I call ie

# ./create_new_user.sh dave engineer

This then creates a linux and samba user account for the new user, a 
home folder, and creates accounts in apache2 to allow subversion and git 
access and generally performs all the relevant configuration for the new 
user account.

*My Question*

So far this all works great, but I have a problem when it comes to 
backups. I need to be able to backup not just the data on my fileserver 
(easy!) but also the full samba user configuration (harder!). This is to 
ensure that if I ever need to restore a backup I not only have my 
original data but also crucially the exact same usernames and 
corresponding passwords as previously so samba file sharing service can 
resume essentially uninterrupted for my users after the restore.

Unfortunately I couldn't find any official Samba documentation 
describing a recommended way to do this for the specific case of a 
STANDALONE samba file server. I am aware that samba provides official 
tools for backing up the user configuration of a DC, but how can I 
achieve similar results for a standalone file server?

In the absense of any official guidance I managed to achieve a 
successful backup myself by just tarring up the /etc/samba and 
/var/lib/samba folders on my server and then later restoring these 
archives to their original locations.

Obviously my way is crude and unofficial! Is there an officially 
supported and/or recommended method and tools to achieve my aims here? 
Or should I just carry on using my tar files manually as I have described?

Kind Regards

Stephen Ellwood--

Stephen Ellwood,
Embedded System Engineer,
Ogden Safety Systems Ltd,
Unit 6, Cliffe Park Way,
Bruntcliffe Road,
Morley,
Leeds,
LS27 0RY,
UK.

Tel: +44 (0)1937 835395
Email: stephen at ogdenradar.com
URL: www.ogdenradar.com



More information about the samba mailing list