/
[SoftNAS KB]: Using Robocopy

[SoftNAS KB]: Using Robocopy

Robocopy -- Overview and usage

Symptoms

Customer is trying to move a bulk number of file and the robocopy is generating many errors.

Explanation

The Windows client that is running robocopy needs full control permissions to the mounted destination volume.

Resolution

https://wiki.samba.org/index.php/Shares_with_Windows_ACLs#Setup_share_permissions

SeDiskOperatorPrivilege

  • To configure share permissions, you need an account with „SeDiskOperatorPrivilege“. To grant this privilege, e. g. to the „Domain Admin“ group, run the following command on your AD member server(s):

# net rpc rights grant 'SAMDOM\Domain Admins' SeDiskOperatorPrivilege -U'SAMDOM\administrator' -I dc1.samdom.example.com


Existing privileges can be reviewed by

# net rpc rights list accounts -U'SAMDOM\administrator' -I dc1.samdom.example.com
 

Examples:

Examples of Microsoft's Robocopy Syntax

#1 -- To copy contents of C:\UserFolder to C:\FolderBackup:

         Robocopy C:\UserFolder C:\FolderBackup

This is the simplest usage for Robocopy


#2 -- To copy all contents including empty directories of SourceFolder to DestinationFolder:

Robocopy C:\SourceDir C:\DestDir /E


#3 -- List only files larger than 32 MBytes(33553332 bytes) in size.

            Robocopy.exe c:\sourceFolder d:\targetfolder /min:33553332 /l

List only files less than 32 MBytes(33553332 bytes) in size.

          Robocopy.exe c:\sourceFolder d:\targetfolder /max:33553332 /l


Notes:

 -------------------------------------------------------------------------------

   ROBOCOPY     ::     Robust File Copy for Windows                            

-------------------------------------------------------------------------------

              Usage :: ROBOCOPY source destination [file [file]...] [options]

              source :: Source Directory (drive:\path or \\server\share\path).

       destination :: Destination Dir (drive:\path or \\server\share\path).

               file :: File(s) to copy (names/wildcards: default is "*.*").

 More options are shown with:

                C:\ robycopy /?


References:

  1. Robocopy was a part of Windows Resource Kit Tools
  2. Articles 1073 -- Robocopy and a few examples
  3. robocopy :: create backup script
  4. FriendlyRoboCopy: A User’s Guide

Related content

[SoftNAS KB]: How to enable Previous Versions on CIFS with AD integration.
[SoftNAS KB]: How to enable Previous Versions on CIFS with AD integration.
More like this
Managing CIFS shares permissions after joining AD
Managing CIFS shares permissions after joining AD
More like this
GOP Policy on Windows Server 2016
GOP Policy on Windows Server 2016
More like this
[SoftNAS KB]: Create a local Samba User Account to access CIFS Shares when not joined to Active Directory
[SoftNAS KB]: Create a local Samba User Account to access CIFS Shares when not joined to Active Directory
More like this
How to set up Minimum Permissions required to join SoftNAS to AD
How to set up Minimum Permissions required to join SoftNAS to AD
More like this
[SoftNAS KB]: How To Configure Existing AD (for 2008 and up) with NIS Server to SoftNAS Samba
[SoftNAS KB]: How To Configure Existing AD (for 2008 and up) with NIS Server to SoftNAS Samba
More like this