XCOPY syncronise?

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

  1. *Darren*

    *Darren* Guest

    Hi

    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

    Thanks

    Darren
     
    *Darren*, Jan 30, 2007
    #1
    1. Advertisements

  2. *Darren*

    kj Guest

    Use robocopy instead.
     
    kj, Jan 30, 2007
    #2
    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
    #3
  4. In
    Agreed - with the /MIR switch.
     
    Lanwench [MVP - Exchange], Jan 30, 2007
    #4
  5. *Darren*

    *Darren* Guest

    "Lanwench [MVP - Exchange]"
    I only want to purge once a month.....
     
    *Darren*, Jan 30, 2007
    #5
  6. In
    That's fine - you just need to play with scheduled tasks and different batch
    files.
     
    Lanwench [MVP - Exchange], Jan 30, 2007
    #6
  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?

    Thanks
     
    *Darren*, Jan 31, 2007
    #7
  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)

    http://www.sbits.biz/CleanUp/

    Russ

    --

    Russell Grover
    SBITS.Biz
    Microsoft Certified Small Business Specialist.
    MCP, MCPS, MCNPS, (MCP-SBS)
    support @ SBITS.Biz
    Remote Computer Support
    http://www.SBITS.Biz


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

    *Darren* Guest

    Hi

    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
    #9
  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
    #10
  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
    #11
  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

    then

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

    (MIR is the equivalent of /e and /purge, apparently, but I haven't ever used
    purge)
     
    Lanwench [MVP - Exchange], Jan 31, 2007
    #12
  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
    #13
  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
    #14
  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
    #15
  16. *Darren*

    *Darren* Guest

    "Lanwench [MVP - Exchange]"

    I thought it only mirrored one way
     
    *Darren*, Feb 1, 2007
    #16
  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
    luck.
     
    Lanwench [MVP - Exchange], Feb 1, 2007
    #17
    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.