[Samba] samba 4.13: backup script: FileNotFoundError

Rowland Penny rpenny at samba.org
Mon Nov 22 09:05:59 UTC 2021


On Mon, 2021-11-22 at 08:36 +0000, James Dingwall via samba wrote:
> Hi,
> 
> Ubuntu 20.04 recently updated samba from 4.11 to 4.13.  Since then
> the backup
> script has started failing:
> 
> running backup on dirs: /var/lib/samba/private /var/lib/samba
> /etc/samba
> ERROR(<class 'FileNotFoundError'>): uncaught exception - [Errno 2] No
> such file or directory: '/var/lib/samba/dfs/netlogon'
>   File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py",
> line 186, in _run
>     return self.run(*args, **kwargs)
>   File "/usr/lib/python3/dist-
> packages/samba/netcmd/domain_backup.py", line 1105, in run
>     if any(os.path.samefile(full_path, file) for file in all_files):
>   File "/usr/lib/python3/dist-
> packages/samba/netcmd/domain_backup.py", line 1105, in <genexpr>
>     if any(os.path.samefile(full_path, file) for file in all_files):
>   File "/usr/lib/python3.8/genericpath.py", line 100, in samefile
>     s1 = os.stat(f1)
> 
> Assuming that I set my DFS up correctly I think the cause is that
> 'netlogon'
> is a dangling link:
> 
> $ ls -l /var/lib/samba/dfs/netlogon
> lrwxrwxrwx 1 root root 43 Mar 26  2021 /var/lib/samba/dfs/netlogon ->
> msdfs:dc0\netlogon,dc1\netlogon
> 
> Should the directory backup script handle this case or should I move
> the [dfs]
> share?

You appear to be using the old method of backup, it has been replaced
by 'samba-tool domain backup'

Try reading this:

https://wiki.samba.org/index.php/Back_up_and_Restoring_a_Samba_AD_DC

Rowland





More information about the samba mailing list