WD Community

Batch files and permissions

Being a belt and braces sort of fella I have two NAS devices - a ReadyNAS  and a WD EX4  for my backups. I use batch files to backup from my WIN7 to my NASs on alternate days. Most of the time I use Xcopy and the commands /d /s /y and all is sweetness and light.

However for my ebook library I use Robocopy with its /mir command, this means that it maintains an exact copy of the original occasionally it needs to delete files as well as add or overwrite files. On the ReadyNAS there is no problem but on the EX4 when it has to delete files Robocopy makes a couple of attempts as instructed then gives up.

How can I tell the EX4 NAS to allow it to delete files as well as write them?

As an aside I notice that sometime when I use Windows Explorer to delete files on the EX4 it allows me to delete some but not others telling me I don’t have permission to delete. I have to go into the Dashboard to do it from there.

A snippet of the batch file (which is proven to work - the  variables are just to enable the same batch file to be used with two different NAS devices on odd and even days and save a lot of typing)

SET ThisPath=%NASPath%\EDrive\ISO Files\
xcopy “E:\ISO Files\*.*” “%ThisPath%” /y /d
echo.
SET ThisPath=%NASPath%\DDrive\Calibre Library
robocopy “D:\Calibre Library” “%ThisPath%” /mir /R:1

Any ideas?

I am yet to see a batch process tutorial for file management or a script being shared by a member of the WD Community. I am not aware if a full-scale process is even possible in a safely manner. However, you could recommend it as an idea for future implementation. The best place for this, is in the Ideas Exchange section.

Network Product Ideas

The /MIR option in Robocopy causes the file permissions to be synced along with the file itself.  Since the My Cloud is a Linux device and your script is running on Windows, perhaps the difference in how those two systems handle permissions might be behind the issue.  Can you try your sync script without /MIR?  AFAIK, the My Cloud only assigns permissions at the top level of a share so syncing the perms on child folders might be redundant and/or confusing (to the system).

Can you specify what file types cannot be deleted?  Any pattern in the type or file location that might provide a clue?  

Support for Western Digital Hard Drives | Western Digital

Still Need Help?

Reach out to Support for more assistance.

Sign in to Your Support Account

Get up-to-date information about your products.

Western Digital Business Portal

Unlock benefits and tools for your business such as enterprise support, pricing and rebate tools, marketing, loyalty, rewards, and more.