acrobson Posted September 8, 2007 Posted September 8, 2007 Hi all, Hope your enjoying the little darlings going back! Does anyone happen to use or have used Robocopy, i am aware it is very popular however up until now we have not been able to use it because it was FREE, they would rather pay then get something for free...! We are looking into using it for a simple copy from source A to source B, has anyone got any tips or have any templates which we could have a look at. We have downloaded the resource kit etc, however time is against us unfortunately! Cheers,
MkII Posted September 8, 2007 Posted September 8, 2007 There's a gui for it (google robocopy gui), but just list the commands, it's not as complex as it looks.
acrobson Posted September 8, 2007 Author Posted September 8, 2007 There's a gui for it (google robocopy gui), but just list the commands, it's not as complex as it looks.Thanks Mark, I have had at the GUI and that seems okay for the time being, however we would like to get into the full blown Robocopy. To be honest we are fine with listing the commands etc, it's mainly the first command line where we are having problems, such as telling it the source and destination information. Any help from anyone would be apprechiated.
robk Posted September 8, 2007 Posted September 8, 2007 What do you need to do? Robocopy is a really great tool, the command syntax is a bit tricky until you get used to it. Just migrated all our user accounts with a robocopy script & have a few example scripts available, could PM you one if needed. Rob
acrobson Posted September 8, 2007 Author Posted September 8, 2007 What do you need to do? Robocopy is a really great tool, the command syntax is a bit tricky until you get used to it. Just migrated all our user accounts with a robocopy script & have a few example scripts available, could PM you one if needed. RobThat would be really helpful actually Rob, basically we need to copy about 100 gig's of data from one drive to another, however when using windows explorer etc it keeps flagging up errors and the files get scanned by Sophos and keep getting blocked. We just need a script which we can input our source and destination info in etc for now and then look at making our own for future projects etc. An example script would be really helpful.
mattx Posted September 8, 2007 Posted September 8, 2007 and the files get scanned by Sophos and keep getting blocked. Errr, just stop Sophos then ? When ever I do a large file copy I normally use Xcopy but then only do the copy in stages, not as one job lot. . . . OK it takes a bit more time but at least you have an element of control. A few examples which may help: 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 The MOVE option will fail if any files are open and locked. 1
acrobson Posted September 8, 2007 Author Posted September 8, 2007 and the files get scanned by Sophos and keep getting blocked. Errr, just stop Sophos then ? When ever I do a large file copy I normally use Xcopy but then only do the copy in stages, not as one job lot. . . . OK it takes a bit more time but at least you have an element of control. A few examples which may help: 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 The MOVE option will fail if any files are open and locked.I would love to stop Sophos, however, that is not an option under the LEA agreement, plus it's the LEA that control that server, meaning we can't adjust things to work properly!
mattx Posted September 8, 2007 Posted September 8, 2007 it's the LEA that control that server So who enters the command for the robocopy ? If its you, then you could do a net stop on the sophos service...
acrobson Posted September 8, 2007 Author Posted September 8, 2007 it's the LEA that control that server So who enters the command for the robocopy ? If its you, then you could do a net stop on the sophos service...I am one of the team which will be handling the Robocopy however with Sophos, as it is connected to the sophos console server it flags an alert up stating an issue with Sophos, in turn telling the LEA that where up to something. Not that i have ever tried that before, never...wouldn't even think of it! heheehe Thanks for the example though, any more would be much apprechiated.
robk Posted September 8, 2007 Posted September 8, 2007 What do you need to do? Robocopy is a really great tool, the command syntax is a bit tricky until you get used to it. Just migrated all our user accounts with a robocopy script & have a few example scripts available, could PM you one if needed. RobThat would be really helpful actually Rob, basically we need to copy about 100 gig's of data from one drive to another, however when using windows explorer etc it keeps flagging up errors and the files get scanned by Sophos and keep getting blocked. We just need a script which we can input our source and destination info in etc for now and then look at making our own for future projects etc. An example script would be really helpful. I used the following to copy our home dirs back from external USB drive ready after a server rebuild. G is the usb drive, e the data drive. the /COPY:D stops the file permissions being changed. The default from memory is DAT which copies Atributes and ACLS. robocopy g:\ e:\ /COPY:D /xd g:\recycler /xd "g:\System Volume Information" /xo /e /zb /R:5 /LOG:"g:\restore.log" /TEE /w:1 Note that robocopy can be restarted so you can look at the log, remove a problem file and re-start. Hope this helps. PM me if you need more.
acrobson Posted September 9, 2007 Author Posted September 9, 2007 Hi people, Just a quick thanks for you help on this one, I have finally managed to get it sorted, what a great piece of kit. I have seen it in use previously, but didn't understand its true potential. I am wondering if it would be worth me publishing a couple of template scripts for other Robocopy newbies to download etc. Cheers,
contink Posted September 9, 2007 Posted September 9, 2007 I am wondering if it would be worth me publishing a couple of template scripts for other Robocopy newbies to download etc. Wouldn't hurt and I'd certainly appreciate it as I'm getting ready to do some work with this myself..
acrobson Posted September 9, 2007 Author Posted September 9, 2007 As mentioned, here are a few scripts which I have used and adapted, they have all worked fine for me recently. Note: You need Windows XP Resource Kit installed for the robocopy.exe This script copies from source drive to destination drive, the /XF *.? is where you can define file types which you do not wish to be copied, such as .xls etc. The /XD excludes directories matching given names/paths. The /XO excludes items with the age older or the same date/time stamp. The /E copies subfolders, including Empty Subfolders. The /ZB uses restartable mode; if access denied use Backup mode. The /ETA displays the progress in the out file. The /R:1 states the time length in which to wait on a fail copy in which to re-try. The /W: defines the time in which to wait between retries. robocopy l:\source g:\destination /COPY:D /XF *.? /xd l:\Source /xd l:\Source /xo /e /zb /ETA /R:5 l:\restore.log /TEE /W:1 The following script is similar to above, however it has the /XD removed which enables you to exclude certain file types etc. robocopy l:\Support g:\Support /COPY:D /xd l:\Support /xd l:\Support /xo /e /zb/R:5 l:\restore.log /TEE /W:1 Once you have customised you source and destination locations, you can enter either of these into you cmd box for robocopy and they should work. If anyone has any additional scripts, such as more complex ones, please share them.
ICT_GUY Posted September 10, 2007 Posted September 10, 2007 The easy way. Use ntbackup, backup to a file (fast), restore the backup to a new location with all permissions correct. This is about 10 - 20 x faster than robo copy.
azrael78 Posted September 12, 2007 Posted September 12, 2007 This is my first post to the forums - just want to say that ROBOCOPY is a wonderful tool. I use it alot for script-based copy jobs (like rolling out start menu changes to the global desktop areas and such). Something to look at however - read up on the /COPYALL switch, if you want to preserve file attributes/NTFS ACLs and such - you will want to use that switch. 1
parasj Posted December 22, 2007 Posted December 22, 2007 Hello, Here are a few tips/caveats about using Robocopy. In a nutshell its a great tool. 1. Using the /MIR switch will delete files & directories from the destination directory if it is not empty. This is because the MIR switch makes the destination directory an exact mirror image of the source directory 2. By default, Robocopy copies the NTFS permissions from the source directory to the destination directory. This is not a problem. However, consider this scenario - if you copy files from one server to another using UNC paths and only a specific administrator account has access to the files on the source server and that administrator account does not exist on the destination server then you will have to reset the permissions on all files on the destination server. We recently had to do this for 1.5 TB worth of data which took a couple of hours. We should have set Permission Inheritance on the destination server and copied the files using the /COPY:DAT switch instead of the default /COPY:DATS 3. It is good to run Robocopy in the Simulation mode first (use the /L switch) to detect any security/access errors early 4. Use the /B switch to override ACLs and give the administrator access to all files, even if the ACL does not permit so 5. When copying over WAN connections run multiple instances of Robocopy with the same source and destination UNC paths. This will improve the throughput and will not lead to any data loss or corruption 6. To schedule robocopy jobs use the Windows Task Scheduler instead of the robocopy /RH switch. This gives you better control over when the job starts and how frequently and for how long it runs. Use the /LOG+ switch instead of /LOG to append to the log file if the robocopy job runs multiple times 7. The default values of the /R and /W parameters are useless. If a file cannot be copied for some reason then robocopy will try a million times and wait for 30 seconds between retries. You may want to change this 8. Copying files locked by other applications and services is a bit tricky, see - http://blogs.msdn.com/adioltean/archive/2006/09/18/761515.aspx. You shouldn't be doing this anyway, because it can lead to corrupt backup state for such files. 9. The use of the /E switch and the /MAXAGE switch will create all the sub-directories in the source in the destination directory, even if NO files in those sub-directories will be copied 10. Be careful, by default, if a MORE RECENT file with the same name exists in the destination folder, IT WILL BE OVERWRITTEN. Use the /XO - exclude older, switch to avoid this, if required. Hope this helps - Paras Jethwani
ChrisH Posted December 22, 2007 Posted December 22, 2007 Thanks for that very thorough and probably worth a wiki entry.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now