robocopy /mov help

John JY 221 Reputation points
2021-03-05T22:04:53.113+00:00

HI,

The files older than 12/31/2020 are needed to move the other share(windows 2012). I tried to use
robocopy souce destination /mov /minage:63 /zb /mir /mt /r:5 /w:5

the files security and ownerships are needed to keep on the destination.

Can the above command keep files security and ownership?

Thank you for your help!

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,166 questions
{count} votes

Accepted answer
  1. MotoX80 34,081 Reputation points
    2021-03-06T13:22:55.007+00:00

    The /mir (mirror) switch conflicts with the /mov (move) switch. Try this instead.

    robocopy C:\Temp\src C:\Temp\dest /mov /e /minage:63 /zb /COPY:DATSO  /r:5 /w:5 /l
    

    The /l switch will perform a "whatif" operation and show you what it would move, but not actually do a copy.

    /e will tell robocopy to process subfolders.

    Pick one subfolder and test with that first. Run it initially with the /l and review the output. Then run it without /l and verify that the files you expected to be moved were in fact moved and that the permissions look correct.

    Permission inheritance on the destination folders may affect the final permissions.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. John JY 221 Reputation points
    2021-03-10T21:38:16.627+00:00

    somehow, it does not accept storage UNC paths. Can anyone help with powershell script to do the same? Thank you!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.