Posted on 2006-03-21
Last Modified: 2012-05-05

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.  
Question by:Nael_Shahid
    LVL 28

    Accepted Solution

    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,


    LVL 28

    Expert Comment

    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
    LVL 28

    Expert Comment

    and note that files that are opened with write access while robocopy runs (i.e. open Word docs) will not be copied!

    Author Comment

    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?
    LVL 28

    Expert Comment

    For backup of open files add to the command line parameters


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

    I've never played with it....

    To completely sync the Backup use


    /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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
    Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now