[Samba] Robocopy from Windows to Samba (3.6.3) with backup flag

Jeremy Allison jra at samba.org
Tue Mar 13 11:18:59 MDT 2012


On Tue, Mar 13, 2012 at 11:27:07AM +0100, Vincent Miszczak wrote:
> Hello,
> 
> I need to copy a Windows NAS to a Samba one preserving all stuffs (dates, owner, security, etc...) in an enterprise environment.
> 
> I'm used to do that with between two Windows using robocopy  and the /b (backup) flag, so I can backup files even if I do not have an ACE for my account as I have the backup and restore privileges.
> 
> I need to do the same thing from Windows to Samba but using the backup flag does not work at all : it does not even copy the data. If I copy without the backup flag, it's OK for the files I have access, but as I am in an enterprise, I don't have access to all files.
> 
> Here what happens :
> (From the Windows NAS) :
> 
> robocopy G:\share\XXXXX\04_generique \\samba-nas\root$\xfs\shares\archives\XXXXX\04_generique /V /NS /NC /NDL /NFL /S/E /COPY:DATS /B /NP /XJ /R:0 /W:30
> 
> 2012/03/13 10:56:18 ERROR 87 (0x00000057) Copying NTFS Security to Destination Directory G:\share\ XXXXX \04_generique\
> The parameter is incorrect.
> 
> 
> ð  No data is copied :/
> 
> If do the same without the /B flag, it's OK in this particular case, but I don't have access to all the data and I won't be able to.
> 
> I have tested on Centos 6 with Samba 3.5.10 and Samba 3.6.3 and I have the same result.
> 
> Is this supposed to work ?

Not in 3.6.x yet (it's being fixed for 4.0 and may get back-ported).
SeBackup/SeRestore require some special case code to ensure this
is done securely with no security holes or races.

> Are there "special" parameters in smb.conf for this to work ?
> If not, how can I backup from Windows to Samba ?

Currently the best way is to create a custom share, which
uses "force user = root" and is set with the valid users
set to those users who have SeRestore privilege.

This works, but I agree it's a little clunky. I'm working
on it.

Jeremy.


More information about the samba mailing list