I've got a Windows 7 Ultimate system which maps a Samba 3.0.33 share. I have no problems reading, writing, or replacing any files or directories from windows file explorer. I have attempted to set up a push/pull sync script on the windows client using xcopy. I am trying to replace any files newer than the corresponding file/directory in either direction. The copy from the server to the client works great. The copy from the client to the server fails with "access denied" (when the directory already exists - new directories can be created without issue).
This is my windows script:
xcopy c:\source_dir z:\dest_dir /D /E /I /F /R /Y
xcopy z:\dest_dir c:\source_dir /D /E /I /F /R /Y
Here's what I see for the first command:
C:\Source_dir>xcopy c:\Source_dir\test z:\Dest_dir\test /E /I /F /R /Y
Access denied
Unable to create directory - Z:\Dest_dir\test
0 File(s) copied
The same command works fine on an XP system connected to the same server. There must be something I'm missing - any ideas what it might be?
Thanks!
PS: I forgot to mention that if the directory does not exist already on the server, the xcopy command to the server succeeds.
PPS: Robocopy yields identical results.
I would suggest switching to robocopy since
xcopy /?
says "NOTE: Xcopy is now deprecated, please use Robocopy."Noticed that new directories were backed up okay and that the listed owner and group was different than the older directories and files. Solved my XP to Samba share permission issue by changing the owner and group. Backup xcopy running fine now!
Was giving
even with no needed files there. When I chmod that 2002 directory to nobody and nogroup - it would get past that dir error! So then I reapplied recursively all files and folders.
Make sure that the account you connect with has permission on the server side to create directories Z:\Dest_dir\
mkdir z:\Dest_dir\test creates the same result?
As said above, i'd check the permissions on the server side.
Sorry to resurrect a question from the dead, but I would guess that you need to take a look at your create mask in your samba settings. The default is 755, so if your user account is not the owner of the directory then any new directories or files you create will not be writable by that account. The root directory probably has more permissive unix file permissions, perhaps 775, which is why you're able to create new files and directories in the first place.
I also ran into this issue (Win 7 and 8) with
robocopy
andxcopy
failing with error messages indicating failure to create folders, whereas copying via explorer orcopy
still worked.I was able to get this working by using the following config options:
force create mode
force directory mode
Specifically
0774
and0775
in my setup. Apparently something is going haywire with permissions whenrobocopy
orxcopy
were being used. This does seem to indicate some sort of configuration issue, and this solution is rather indiscriminate, but that's all I can figure out for now.Server is FreeNAS 9.2.1.3 running Samba 4.1.6