[Samba] How to make an unattended backup

Rowland penny rpenny at samba.org
Wed Sep 11 19:12:26 UTC 2019

On 11/09/2019 19:57, Andrew Bartlett wrote:
> On Wed, 2019-09-11 at 19:43 +0100, Rowland penny via samba wrote:
>> On 11/09/2019 19:36, Andrew Bartlett via samba wrote:
>>> On Wed, 2019-09-11 at 15:14 -0300, Sergio Belkin via samba wrote:
>>>> Hi,
>>>> I use AptVanBelle repo for samba, is there a way to backup in unattended
>>>> way (I mean via cron) the DC?
>>>> If I use
>>>> samba-tool domain backup online --targetdir=/srv/backup --server=
>>>> samba4.example.com  -k yes -d1
>>>> It works, by it ask for password Administrator.
>>>> What is the best practice to do it?
>>> The offline backup can be done unattended.
>>> It may also be possible to to the online backup unattended using the
>>> DC's own password using --machine-pass, but I've not tried that yet
>>> (sorry).
>>> Andrew Bartlett
>> I have, it doesn't work ;-)
> That's a pity.  I do wonder why, because this (and the offline that you
> keep on saying prompts for a password) just worked for me in a master
> testenv.
> Very odd.
> Andrew Bartlett
I am not the only person that says it prompts for a password and I have 
run it again and it prompted for a password:

root at dc4:~# kinit Administrator

Password for Administrator at SAMDOM.EXAMPLE.COM:

root at dc4:~# samba-tool domain backup online --targetdir=/root/ 
--server=dc4 -k yes

It prints various messages, then this:

Committing SAM database
INFO 2019-09-11 20:05:57,811 pid:21207 
/usr/lib/python3/dist-packages/samba/join.py #1652: Setting 
isSynchronized and dsServiceName
INFO 2019-09-11 20:05:57,847 pid:21207 
/usr/lib/python3/dist-packages/samba/join.py #1564: Cloned domain SAMDOM 
(SID S-1-5-21-1768301897-3342589593-1064908849)
Password for [Administrator at SAMDOM.EXAMPLE.COM]:
INFO 2019-09-11 20:06:04,447 pid:21207 
/usr/lib/python3/dist-packages/samba/netcmd/domain_backup.py #124: 
Creating backup file 

Notice the password prompt ????

If you just press enter, the backup completes without error. I tracked 
it down to where it backs up sysvol.


More information about the samba mailing list