Xcopy create directory fails

Status
Not open for further replies.

jlpellet

Patron
Joined
Mar 21, 2012
Messages
287
I expect I'm missing something obvious but am having a problem with xcopy creating directories on 1 of my FreeNAS 9.3 STABLE servers (all latest update). In the batch file excerpt shown below, the last line fails with an "access denied" error & same from command line. However, MD from the CL creates the same dir - very confusing. As near as I can tell, the GUI volume permissions, CIFS, & share are the same across the servers & the smb4.conf are also the same. Any ideas/suggestions appreciated.

xcopy D:\__DVD\*.* \\FN1\Stores\Videos\__DVD\*.* /s /a /y
xcopy D:\__DVD\*.* \\FN2\Stores\Videos\__DVD\*.* /s /a /y
xcopy D:\__DVD\*.* \\FN3\Stores\Videos\__DVD\*.* /s /a /y
xcopy D:\__DVD\*.* \\FN4\Stores\Videos\__DVD\*.* /s /a /y
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Compare getfacl for shares and subdirectories for FN3 and FN4. There should be some sort of discrepancy. Also verify that credentials are identical on FN4.
 

jlpellet

Patron
Joined
Mar 21, 2012
Messages
287
Thanks for the suggestions. Below are the results & I don't see a difference. Also, note that if I create the target directory from the command line, it succeeds. From the same command line, xcopy fails. If the directory exists before the xcopy, it is deleted after the xcopy run and error. Robocopy produces the same result, as does doing the same thing from another Win7 system. Dragging the directory from the Win7 file explorer GUI works. In pre-9.2.1.8, this would happen if the local user was not set but, per the docs, local user is now default & the choice was removed from the GUI CIFS. As far as I can tell, the credentials are the same.

FN4 (broken)

[root@fn4 ~]# ls -l /mnt/z2
drwxrwxr-x+ 27 guest guest 27 Jan 19 22:20 __DVD

[root@fn4 ~]# getfacl /mnt/z2/__DVD
# file: /mnt/z2/__DVD
# owner: guest
# group: guest
owner@:rwxpDdaARWcCos:fd----:allow
group@:rwxpDdaARWcCos:fd----:allow
everyone@:r-x---a-R-c---:fd----:allow

FN3 (working)

[root@fn3 ~]# ls -l /mnt/z2
drwxrwxr-x+ 25 guest guest 25 Jan 17 22:34 __DVD

[root@fn3 ~]# getfacl /mnt/z2/__DVD
# file: /mnt/z2/__DVD
# owner: guest
# group: guest
owner@:rwxpDdaARWcCos:fd----:allow
group@:rwxpDdaARWcCos:fd----:allow
everyone@:r-x---a-R-c---:fd----:allow
 

jlpellet

Patron
Joined
Mar 21, 2012
Messages
287
I solved this by deleting the account, volume, & shares then recreating. AFAIK, using the same setting & xcopy worked correctly.
 

jlpellet

Patron
Joined
Mar 21, 2012
Messages
287
Had the same problem arise on a different server this evening (it worked ok this morning). Just to try, I added a file mask of 0777 to CIFS then restarted it, which seems to have allowed xcopy to succeed.
 

Starpulkka

Contributor
Joined
Apr 9, 2013
Messages
179
I recommend to not use xcopy. I used it before i wasn't able to properly use robocopy, and 1 year later i noticed that xcopy has silently skipped some files by not copying them. It then learned robocopy and it is good.
 
Status
Not open for further replies.
Top