RoboCopy, short for Robust File Copy Utility, is great for synchronizing directories, making a quick backup of a USB drive, or just refreshing a backup with files that have recently changed. I know you can do much of the same thing with the Synchronize panel within Opus, but I like to be able to launch RoboCopy within a DOS script and navigate away without having to wait for Opus to do its thing.
If your not familiar with RoboCopy, it's a DOS Utility from Microsoft, which comes with Windows now but was originally available in the Windows Server 2003 Resource Kit, http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
From the Help File:
If needed: How to use buttons and scripts from this forum
I have two scripts that I use almost everyday that I'll share:
1) RoboCopy everything NEWER from Source to Destination including all sub folders
<?xml version="1.0"?>
<button display="both" separate="yes">
<label>RoboCopy /e /xo</label>
<tip>RoboCopy /e /xo</tip>
<icon1>87</icon1>
<function type="batch">
<instruction>@echo off</instruction>
<instruction>color 0b</instruction>
<instruction>echo --------------------------------------------------</instruction>
<instruction>echo D I R E C T O R Y O P U S - R O B O C O P Y </instruction>
<instruction>echo RoboCopy Script for DOpus v9.x</instruction>
<instruction>echo --------------------------------------------------</instruction>
<instruction>echo. </instruction>
<instruction>echo robocopy {sourcepath$|noterm} {destpath$|noterm} /e /xo /w:1 /r:1 >c:\~temp.cmd</instruction>
<instruction>echo pause>>c:\~temp.cmd</instruction>
<instruction>call c:\~temp.cmd</instruction>
</function>
</button>
The switches in the command line explained
/e
- everything including all subfolders/xo
- exclude anything older/w:1
- if the file is in use, wait 1 second before retrying/r:1
- number of retries
2) RoboCopy MOVE everything NEWER from Source to Destination including all sub folders
<?xml version="1.0"?>
<button display="both">
<label>RoboCopy /move /e /xo</label>
<tip>RoboCopy /move /e /xo</tip>
<icon1>87</icon1>
<function type="batch">
<instruction>@echo off</instruction>
<instruction>color 0b</instruction>
<instruction>echo --------------------------------------------------</instruction>
<instruction>echo D I R E C T O R Y O P U S - R O B O C O P Y </instruction>
<instruction>echo RoboCopy Script for DOpus v9.x</instruction>
<instruction>echo --------------------------------------------------</instruction>
<instruction>echo. </instruction>
<instruction>echo robocopy {sourcepath$|noterm} {destpath$|noterm} /e /move /xo /w:1 /r:1 > c:\~temp.cmd</instruction>
<instruction>echo pause >> c:\~temp.cmd</instruction>
<instruction>call c:\~temp.cmd</instruction>
</function>
</button>
The switches are the same as the first example with the addition of
/move
When RoboCopy completes it presents a summery (see snapshot below) of the number of files copied, skipped, etc so I've built in a pause so the window doesn't close before you have a chance to see it. You can always remove the pause or replace with a delay such as ping -n 5 127.0.0.1 > nul
You can also use /MIR
to mirror directories (be careful), /LOG
to create logfiles. Check the documentation or RoboCopy /?
to see extended information of all the switches.
In my opinion, Directory Opus is the greatest, but when is comes to large copy or move jobs, sometimes it's better to pass it to DOS.
Oh, yes, it does work \\unc to \\unc
Hope someone finds this useful.
~ Sam