Results 1 to 4 of 4

Thread: Robocopy script mirror from one computer to the next

  1. #1
    Join Date
    Nov 2011
    Posts
    2

    question Robocopy script mirror from one computer to the next

    I have been playing with robocopy for some time now. I have setup a simple program to mirror my flash drive to whatever computer I plug it into.

    The problem is best explained by this example:

    1. I run the program daily on a certain computer.

    2. I also run this program every once in a while on different computers so these other computers don't have everything new all the time. When I run it on these other computers they backup the entire drive and not just what is new.

    3. when I run this program again on the daily computer after running it some where else it again backs up everything regardless of whats on the computer that is the same as on the flash

    so to sum it up when ever I change computers and backup it backs up everything, instead of just what is new from the last time I backed it up on that computer, and then when I go back to my PC i use regularly it backs up everything all over agian even though nothing has changed.

    I beleive it has to be something with the arichive bit being reset...but I thought robocopy was looking at dates last modified / created not just an archive bit.

    any help would be great!

    here is the robocopy switches/parameters I am using and a sample of part of the program:

    set source=%drivePath%
    set dest=C:\%user%
    set what= /COPYALL /B /MIR
    :: /COPYALL COPY ALL file info
    :: /B copy files in Backup mode.
    :: /SEC copy files with SECurity
    :: /MIR MIRror a directory tree

    set options=/R:0 /W:0 /LOG:%drivePath%\logs\Robo-log.txt /NDL /NP /TEE /XO
    :: /R:n number of Retries
    :: /W:n Wait time between retries
    :: /LOG Output log file
    :: /NDL No dir logging so it doesn't show all directories (shows everything on the flash)
    :: /NP No Progress – don’t display % copied.
    :: /TEE display on screen while logging
    :: /XO If destination has the same file as source with the same date or newer then nothing is copied from source to destination

    echo ### Mirroring...

    ::robocopy command pulling variables from above
    ROBOCOPY %source% %dest% %what% %options%
    Last edited by Foremore; 15-11-2011 at 09:22 PM.

  2. #2
    Join Date
    Dec 2007
    Posts
    2,291

    Re: Robocopy script mirror from one computer to the next

    Can you tell us how is it running now? As a scheduled task? If so, put the scheduled task on hold, edit the script, then unhold the task. There is also a utility that does all the hard work for your and that is called RoboCopyPlus, simply download by searching it from google. It expands on 'native' ROBOCOPY, adding a few switches that let you email the results and logfile.

  3. #3
    Join Date
    Nov 2011
    Posts
    2

    Re: Robocopy script mirror from one computer to the next

    No this is not a scheduled task. I don't want to use another program since it would just be to many clicks.

    all this is is a batch file running whenever I click on it to backup my flash to the computer since a flash isn't reliable but its portable

    Can anyone tell me about the script and say why it would backup everything if I switch to a computer?
    Last edited by Foremore; 17-11-2011 at 02:17 AM.

  4. #4
    Join Date
    Jan 2006
    Posts
    605

    Re: Robocopy script mirror from one computer to the next

    This may do your commandline. I am counting that you will not have spaces in your log file:

    Code:
    $prog = 'c:\script\robocopy'
    $source = '\\global-data-server\global\work\KA'
    $dest = 'c:\test'
    $what = '/COPYALL /B /SEC /MIR'
    $options = '/R:15 /W:53 /TBD /RH:0715-2359 /MOT:39'
    $logg = '/LOG+:C:\temp\_katastrofe_dok2.log /NFL /NDL'
    
    RunWait(@ComSpec & ' /c "' & $prog & '" "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options & ' ' & $l

Similar Threads

  1. Apple iPad 2 mirror image to computer
    By The$Tourist in forum Portable Devices
    Replies: 11
    Last Post: 29-04-2011, 12:50 PM
  2. Need vbs script to add computer in the domain (OU )
    By lolo1790 in forum Windows Server Help
    Replies: 10
    Last Post: 04-03-2011, 05:50 AM
  3. Get computer name as variable to use in vbs script.
    By spacemancw in forum Windows Server Help
    Replies: 5
    Last Post: 30-01-2010, 07:31 AM
  4. Script to Rename Computer Name in Domain
    By skepper in forum Windows Server Help
    Replies: 3
    Last Post: 10-07-2009, 10:05 AM
  5. Startup Script restart computer
    By wwwguy1 in forum Windows Server Help
    Replies: 1
    Last Post: 09-03-2007, 09:11 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,661,754.51241 seconds with 17 queries