copy sqlserver datafile with robocopy

Hello,

I search a command to copy sqlserver datafile with robocopy for keeping ntfs permissions, optimize duration of copy and exclude one file test.mdf

Thank you
bibi92Asked:
Who is Participating?
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
robocopy c:\src d:\dst /XF test.mdf /Z /MT:32 /R:1 /W:5 /copyall 

Open in new window

This runs 32 threads to copy, and performs a single retry after 5 seconds if a file cannot be copied (e.g. is in use). No subfolders are considered for the copy.
0
 
CalmSoulCommented:
Here is an example:

robocopy E:\bin\SQL\Databases\2012 "H:\Program Files\MSSQL11.MSSQLSERVER\MSSQL\Data" /Z
0
 
bibi92Author Commented:
Thanks but for exclude file

Regards
0
 
bibi92Author Commented:
Thanks best regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.