Solved

Need to make perfect copy of directory on another Drive.

Posted on 2006-11-29
9
897 Views
Last Modified: 2012-06-27
I have a windows 2003 server and I need to copy a large directory/fileshare that has lots of sub directories and permissions on it.  I need to copy it to another drive and retain the permissions.  To make matters more complicated there are a bunch of files that start with ._ in there eg. ._stuff.pdf windows seems to have a problem copying these files.  I think they are from the one mac that we have connected to that drive.  some sort of utility command line or not would be great.  any ideas?
0
Comment
Question by:walub
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 5

Expert Comment

by:megs28
ID: 18037826
From the server you want to copy the files TO, map a drive to the folder you want to copy.  In my example I used the Z drive as the source, and c:\folder as the destination.

Run the command:  xcopy z:\*.* c:\folder /e/g/h/k/o

/e - Copies directories and subdirectories, including empty ones
/g - will copy encrypted files even if the destination doesn't support encryption
/g - Copies hidden and system files
/k - Copies attributes
/o - Copies file ownership and ACL information

You can look at the switches for xcopy to determine if you want to add more or remove some.  Just type in xcopy /? from a command line.  Remember that it's faster to push than pull.

I've copied millions of strange files with this method and never had any problems.
0
 
LVL 4

Expert Comment

by:expexchuser
ID: 18037844
xcopy can copy acls.  Use xcopy /? to see the switches.
0
 
LVL 13

Expert Comment

by:rhinoceros
ID: 18037859
try to use "robocopy"

Source options
                /S : Copy Subfolders
                /E : Copy Subfolders, including Empty Subfolders.
 /COPY:copyflag[s] : What to COPY (default is /COPY:DAT).
                      (copyflags : D=Data, A=Attributes, T=Timestamps).
                      (S=Security=NTFS ACLs, O=Owner info, U=aUditing info).
          /COPYALL : Copy ALL file info (equivalent to /COPY:DATSOU).
           /NOCOPY : Copy NO file info (useful with /PURGE)...


More information
http://www.ss64.com/nt/robocopy.html
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:rhinoceros
ID: 18037892
ROBOCOPY.exe (from Windows Resource Kit)

The resource kit tools for XP and 2003 are also available as a free download: Windows Server 2003 Resource Kit Tools - New tools in the download include some neat group policy tools and an updated RoboCopy.

http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
0
 
LVL 13

Expert Comment

by:rhinoceros
ID: 18037949
Advantage:

Robocopy will only copy a file if the source and destination have different time stamps or different file sizes. So you just use shortly time to finish the copy job.
0
 

Author Comment

by:walub
ID: 18037957
I get this when I try to use xcopy
"D:A PHOTO GALLERY\Event Pictures\.DS_Store
File creation error - The system cannot find the file specified.

Unable to create directory - E:\marketing\A PHOTO GALLERY\Event Pictures\Husky
1837 File(s) copied"

I have downloaded robocopy but I am not sure which switches to use.  Can someone give me the command string.  I am not copying over the network just from one drive on the server to another.
0
 
LVL 13

Accepted Solution

by:
rhinoceros earned 125 total points
ID: 18038044
You can map the network drive first,
e.g.
net use p: \\Server1\reports
robocopy c:\reports p:\reports /MIR


Or find more on above web link, where has many good examples...  

Examples:

:: Copy files from one server to another
ROBOCOPY \\Server1\reports \\Server2\backup *.doc /S /NP

:: List all files over 32 MBytes in size
ROBOCOPY C:\work /MAX:33554432 /L

:: Move files over 14 days old
ROBOCOPY C:\work C:\destination /move /minage:14
:: Note the MOVE option will fail if any files are open and locked.

:: The script below copies data from FileServ1 to FileServ2, the destination holds a full mirror (all files), when run regularly to synchronize the source and destination, robocopy will only copy those files that have changed (changed meaning different time stamp or different size.)

@ECHO OFF
SETLOCAL

SET _source=\\FileServ1\e$\users

SET _dest=\\FileServ2\e$\BackupUsers

SET _what=/COPYALL /B /SEC /MIR
:: /COPYALL :: COPY ALL file info
:: /B :: copy files in Backup mode.
:: /SEC :: copy files with SECurity
:: /MIR :: MIRror a directory tree

SET _options=/R:0 /W:0 /LOG:MyLogfile.txt /NFL /NDL
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file
:: /NFL :: No file logging
:: /NDL :: No dir logging

ROBOCOPY %_source% %_dest% %_what% %_options%
0
 
LVL 13

Expert Comment

by:stergium
ID: 18038080
you try total commader who can copy permissions. you can find it at www.totalcmd.net
i too did not had any problem copying mysterious filenames in the past :)
hope that helps
0
 
LVL 5

Expert Comment

by:talkinsmak
ID: 18038722
Here's a command string for xcopy that should do the trick:

xcopy FROMdriveletter:\path\*.* TOdriveletter:\path\*.* /g /o /h /i /c /k /e /r /y

Easy to remember "go hickery"

Let me know.

Smak
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question