XCOPY syncronise?

Discussion in 'Windows Small Business Server' started by *Darren*, Jan 30, 2007.

  1. *Darren*

    *Darren* Guest


    I have used the following command to backup files from 1 drive to another (c
    to d).

    xcopy c:\data d:\data /f /d /e /k /r /h /y

    This means that it copies new and updated files.

    However, if I delete a file on C then it still exists on D.

    How can I tell the xcopy command to also erase files which no longer exist
    on the source


    *Darren*, Jan 30, 2007
    1. Advertisements

  2. *Darren*

    kj Guest

    Use robocopy instead.
    kj, Jan 30, 2007
    1. Advertisements

  3. *Darren*

    *Darren* Guest

    Is there a way of purely running a purge on robocopy?

    i.e. no copying files, JUST purge
    *Darren*, Jan 30, 2007
  4. In
    Agreed - with the /MIR switch.
    Lanwench [MVP - Exchange], Jan 30, 2007
  5. *Darren*

    *Darren* Guest

    "Lanwench [MVP - Exchange]"
    I only want to purge once a month.....
    *Darren*, Jan 30, 2007
  6. In
    That's fine - you just need to play with scheduled tasks and different batch
    Lanwench [MVP - Exchange], Jan 30, 2007
  7. *Darren*

    *Darren* Guest

    "Lanwench [MVP - Exchange]"
    I've tried ROBOCOPY /purge

    but that copies files and purges. How can I make it purely purge?

    *Darren*, Jan 31, 2007
  8. Looks like you are double Posting same question.
    (I'll answer it again)

    This VB Script will purge files older than XX Number of days (Customizable)




    Russell Grover
    Microsoft Certified Small Business Specialist.
    support @ SBITS.Biz
    Remote Computer Support

    Russ Grover \(SBITS.Biz\), Jan 31, 2007
  9. *Darren*

    *Darren* Guest


    thanks but
    that isn't what i want to do.

    I want to delete files from the destination that have already been deleted
    from the source.
    Not "expire" files.
    *Darren*, Jan 31, 2007
  10. In
    Make a copy of the batch file you use for the regular job (scheduled for
    daily run), but append /MIR.
    Schedule that to run monthly.
    Run robocopy /??? for more help.
    Lanwench [MVP - Exchange], Jan 31, 2007
  11. *Darren*

    *Darren* Guest

    "Lanwench [MVP - Exchange]"

    thanks for your help. I've decided im just going to use the MIR command
    daily instead.
    *Darren*, Jan 31, 2007
  12. In
    Make sure you run the job once without the /MIR switch to get all the data
    over to the destination...that's my only advice.

    robocopy "source"\ "destination"\ /e /r:1 /w:1

    (quotes are needed only if there are spaces, and UNC paths are supported)
    /e does subfolders, including empty ones
    /r: means retry once
    /w:1 means wait one second between retries


    robocopy "source"\ "destination"\ /r:1 /w:1 /MIR

    (MIR is the equivalent of /e and /purge, apparently, but I haven't ever used
    Lanwench [MVP - Exchange], Jan 31, 2007
  13. *Darren*

    *Darren* Guest

    "Lanwench [MVP - Exchange]"

    i don't see the need to run it without MIR once.

    MIR will copy everything that isn't already present....so why not use it all
    the time
    *Darren*, Jan 31, 2007
  14. *Darren*

    *Darren* Guest

    oh i think i see your point....so that failures are re-tried, whereas MIR
    won't re-try
    *Darren*, Jan 31, 2007
  15. In
    No, it's because the first time you run the robocopy job, the destination is
    empty, and it's always made me nervous that it will "mirror" itself and
    you'll end up with empty source folders. Why not be cautious?
    Lanwench [MVP - Exchange], Feb 1, 2007
  16. *Darren*

    *Darren* Guest

    "Lanwench [MVP - Exchange]"

    I thought it only mirrored one way
    *Darren*, Feb 1, 2007
  17. In
    What does 'mirror' mean if not "both sides have the same stuff " ?
    Anyway, I think you've got enough info to go on to do what you need. Best of
    Lanwench [MVP - Exchange], Feb 1, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.