Robocopy.exe

Hi,

I am looking to replicate a shared directory on an WinXP internal volume to a external USB/Firewire drive twice daily as a removable backup solution.

I have been looking into using Robocopy.

Has anyone used this utility and if so can you give a starting syntax to work with in the following scenario:

- Copy a shared directory called "Data" from the F:\ drive to an external drive with the drive letter of G:\ drive
- Copy all subdirectories and files
- Copy all security
- Copy once at 12pm and once at 4:30pm Monday to Friday

I have the manual but need to get started asap so would like a starting point from someone who has used the tool.  
 
Nael_ShahidAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michael PfisterCommented:
robocopy F:\ G:\ /E /COPYALL /W:1 /R:3  /LOG+:%TEMP%\Backup.log

/E will copy all files and dirs, incl. empty ones
/COPYALL will copy ALL file info (NTFS, owner, etc.)
/W:1 wait 1 second betwen retries
/R:3 retry 3 times then goto next file
/LOG+: add log info to this file

put the command into a small .CMD or .BAT file and let it start at the desired times with Windows Scheduler.

Hope it helps,

Michael

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Michael PfisterCommented:
Sorry, missed one info. My comand would copy ENTIRE F:\ but you wanted just to copy F:\Data! Better use:

robocopy F:\Data G:\Data /E /COPYALL /W:1 /R:3  /LOG+:%TEMP%\Backup.log
0
Michael PfisterCommented:
and note that files that are opened with write access while robocopy runs (i.e. open Word docs) will not be copied!
0
Nael_ShahidAuthor Commented:
Thanks for that.

Is there no way of copying open files?

Also, what is the switch to remove files and directories from the destination that have been removed from the source?
0
Michael PfisterCommented:
For backup of open files add to the command line parameters

/ZB

/ZB use restartable mode; if access denied use Backup mode.

I've never played with it....


To completely sync the Backup use

/PURGE

/PURGE delete dest files/dirs that no longer exist in source.

But I'd rather keep deleted files in my backup. If someone accidentially deletes a file and doesn't realize this before your backup script runs you can recover the file immediately from the backup drive.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

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.